mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-26 03:11:08 +00:00
* Return status 401 on logout with invalid auth (fixes #4081) * format
This commit is contained in:
parent
ec0a707110
commit
6235ff45b5
1 changed files with 3 additions and 0 deletions
|
@ -56,6 +56,9 @@ impl Display for LemmyError {
|
|||
|
||||
impl actix_web::error::ResponseError for LemmyError {
|
||||
fn status_code(&self) -> http::StatusCode {
|
||||
if self.error_type == LemmyErrorType::IncorrectLogin {
|
||||
return http::StatusCode::UNAUTHORIZED;
|
||||
}
|
||||
match self.inner.downcast_ref::<diesel::result::Error>() {
|
||||
Some(diesel::result::Error::NotFound) => http::StatusCode::NOT_FOUND,
|
||||
_ => http::StatusCode::BAD_REQUEST,
|
||||
|
|
Loading…
Reference in a new issue