-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Currently any endpoint that requires a logged in user has to begin with
let user = match get_user_from_auth_header(&app_state.db, &headers, &app_state.config.app_secret).await {
Ok(user) => user,
Err(e) => return e.into(),
};A second check has to be made if the endpoint would require admin auth
if user.auth_level != AuthLevel::Admin {
return ReturnData::forbidden("Can't do that".to_owned());
}Is there middleware or something which can make this flow more DRY?
Metadata
Metadata
Assignees
Labels
No labels