rocket 5.0 & diesel 2.1

This commit is contained in:
2024-01-02 17:40:05 +08:00
parent 7621f56b34
commit 84943a3965
8 changed files with 41 additions and 193 deletions

View File

@@ -122,12 +122,12 @@ impl<'r> FromRequest<'r> for CurrentUser {
}
} {
if BannedUsers::has(&rconn, &user.namehash).await.unwrap() {
Outcome::Failure((Status::Forbidden, ()))
Outcome::Error((Status::Forbidden, ()))
} else {
Outcome::Success(user)
}
} else {
Outcome::Failure((Status::Unauthorized, ()))
Outcome::Error((Status::Unauthorized, ()))
}
}
}