summaryrefslogtreecommitdiff
path: root/src/login/extract.rs
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-10-01 20:32:57 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-10-01 20:32:57 -0400
commit7645411bcf7201e3a4927566da78080dc6a84ccf (patch)
tree2711922bfeab6dc8b6494e9b0976f3f051dff4a9 /src/login/extract.rs
parent6c054c5b8d43a818ccfa9087960dc19b286e6bb7 (diff)
Prevent racing between `limit_stream` and logging out.
Diffstat (limited to 'src/login/extract.rs')
-rw-r--r--src/login/extract.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/login/extract.rs b/src/login/extract.rs
index b585565..bfdbe8d 100644
--- a/src/login/extract.rs
+++ b/src/login/extract.rs
@@ -2,7 +2,7 @@ use std::fmt;
use axum::{
extract::{FromRequestParts, State},
- http::{request::Parts, StatusCode},
+ http::request::Parts,
response::{IntoResponse, IntoResponseParts, Response, ResponseParts},
};
use axum_extra::extract::cookie::{Cookie, CookieJar};
@@ -10,7 +10,7 @@ use axum_extra::extract::cookie::{Cookie, CookieJar};
use crate::{
app::App,
clock::RequestedAt,
- error::Internal,
+ error::{Internal, Unauthorized},
login::app::ValidateError,
repo::{login::Login, token},
};
@@ -166,7 +166,7 @@ where
{
fn into_response(self) -> Response {
match self {
- Self::Unauthorized => (StatusCode::UNAUTHORIZED, "unauthorized").into_response(),
+ Self::Unauthorized => Unauthorized.into_response(),
Self::Failure(e) => e.into_response(),
}
}