Expand description
login_required macros for actix-loginmanager
§Example
use actix_loginmanager::login_required;
// define or import `user` which implements `UserMinix` trait.
#[login_required(User)]
async fn hello()->impl actix_web::Responder{
user.is_actived(); //can access user:Rc<User>
return "hello";
}
#[login_required(User, name="user")]
async fn hello()->impl actix_web::Responder{
user.is_actived(); //can access user:Rc<User>
return "hello";
}
Attribute Macros§
- login_
required - inject an argument
UserWrapAuth(UserWrap(user)): UserWrapAuth<User>
into the function.