Closed SpootDev closed 2 years ago
rust 1.60 stable rocket_auth = { version = "0.4.0", features = ["sqlx-postgres"] } rocket = { git = "https://github.com/SergioBenitez/Rocket/", features = ["json", "secrets", "uuid"]} rocket_dyn_templates = { git = "https://github.com/SergioBenitez/Rocket/", features = ["tera"]}
I see the traits in the rocket_auth lib.......so, obviously, I'm doing something silly. Looking for input on what I'm doing wrong.
use rocket_auth::{Users, Error, Auth, Signup, Login, User, AdminUser};
fn admin_panel(user: AdminUser) -> String { format!("Hello {}.", user.email()) }
error[E0277]: the trait bound rocket_auth::AdminUser: FromRequest<'_> is not satisfied --> src/admin/bp_user.rs:27:22 | 27 | fn adminpanel(user: AdminUser) -> String { | ^^^^^^^^^ the trait `FromRequest<'>is not implemented forrocket_auth::AdminUser`
rocket_auth::AdminUser: FromRequest<'_>
is not implemented for
Specifying the rc1 cleared this up. rocket = { version = "0.5.0-rc.1", features = ["json", "secrets", "uuid"]} rocket_dyn_templates = { version = "0.1.0-rc.1", features = ["tera"]}
rust 1.60 stable rocket_auth = { version = "0.4.0", features = ["sqlx-postgres"] } rocket = { git = "https://github.com/SergioBenitez/Rocket/", features = ["json", "secrets", "uuid"]} rocket_dyn_templates = { git = "https://github.com/SergioBenitez/Rocket/", features = ["tera"]}
I see the traits in the rocket_auth lib.......so, obviously, I'm doing something silly. Looking for input on what I'm doing wrong.
use rocket_auth::{Users, Error, Auth, Signup, Login, User, AdminUser};
[get("/admin-panel")]
fn admin_panel(user: AdminUser) -> String { format!("Hello {}.", user.email()) }
error[E0277]: the trait bound
rocket_auth::AdminUser: FromRequest<'_>
is not satisfied --> src/admin/bp_user.rs:27:22 | 27 | fn adminpanel(user: AdminUser) -> String { | ^^^^^^^^^ the trait `FromRequest<'>is not implemented for
rocket_auth::AdminUser`