mirror of
https://github.com/danbulant/Portfolio
synced 2026-06-16 13:01:13 +00:00
Revert "fix: fix admin guard to really check for admin role"
This reverts commit 1073fd4d72.
This commit is contained in:
parent
1073fd4d72
commit
ae2198d213
1 changed files with 1 additions and 7 deletions
|
|
@ -30,13 +30,7 @@ impl<'r> FromRequest<'r> for AdminAuth {
|
|||
let session = AdminService::auth(conn, uuid).await;
|
||||
|
||||
match session {
|
||||
Ok(model) => {
|
||||
if model.is_admin {
|
||||
Outcome::Success(AdminAuth(model))
|
||||
} else {
|
||||
Outcome::Failure((Status::Forbidden, None))
|
||||
}
|
||||
},
|
||||
Ok(model) => Outcome::Success(AdminAuth(model)),
|
||||
Err(e) => Outcome::Failure(
|
||||
(Status::from_code(e.code()).unwrap_or(Status::InternalServerError), None)
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue