mirror of
https://github.com/danbulant/Portfolio
synced 2026-07-05 02:50:47 +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;
|
let session = AdminService::auth(conn, uuid).await;
|
||||||
|
|
||||||
match session {
|
match session {
|
||||||
Ok(model) => {
|
Ok(model) => Outcome::Success(AdminAuth(model)),
|
||||||
if model.is_admin {
|
|
||||||
Outcome::Success(AdminAuth(model))
|
|
||||||
} else {
|
|
||||||
Outcome::Failure((Status::Forbidden, None))
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Err(e) => Outcome::Failure(
|
Err(e) => Outcome::Failure(
|
||||||
(Status::from_code(e.code()).unwrap_or(Status::InternalServerError), None)
|
(Status::from_code(e.code()).unwrap_or(Status::InternalServerError), None)
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue