mirror of https://github.com/LemmyNet/lemmy.git
* Return status 401 on logout with invalid auth (fixes #4081) * formatdont_send_karma
parent
ec0a707110
commit
6235ff45b5
|
@ -56,6 +56,9 @@ impl Display for LemmyError {
|
||||||
|
|
||||||
impl actix_web::error::ResponseError for LemmyError {
|
impl actix_web::error::ResponseError for LemmyError {
|
||||||
fn status_code(&self) -> http::StatusCode {
|
fn status_code(&self) -> http::StatusCode {
|
||||||
|
if self.error_type == LemmyErrorType::IncorrectLogin {
|
||||||
|
return http::StatusCode::UNAUTHORIZED;
|
||||||
|
}
|
||||||
match self.inner.downcast_ref::<diesel::result::Error>() {
|
match self.inner.downcast_ref::<diesel::result::Error>() {
|
||||||
Some(diesel::result::Error::NotFound) => http::StatusCode::NOT_FOUND,
|
Some(diesel::result::Error::NotFound) => http::StatusCode::NOT_FOUND,
|
||||||
_ => http::StatusCode::BAD_REQUEST,
|
_ => http::StatusCode::BAD_REQUEST,
|
||||||
|
|
Loading…
Reference in New Issue