summaryrefslogtreecommitdiff
path: root/src/token/extract
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2024-10-02 01:02:58 -0400
committerOwen Jacobson <owen@grimoire.ca>2024-10-02 01:02:58 -0400
commit5d3392799f88c5a3d3f9c656c73d6e8ac5c4d793 (patch)
tree426c568d82b67a98095d25952d2b5b2345a6545b /src/token/extract
parent357116366c1307bedaac6a3dfe9c5ed8e0e0c210 (diff)
Split login and token handling.
Diffstat (limited to 'src/token/extract')
-rw-r--r--src/token/extract/identity.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/token/extract/identity.rs b/src/token/extract/identity.rs
index 42c7c60..60ad220 100644
--- a/src/token/extract/identity.rs
+++ b/src/token/extract/identity.rs
@@ -10,8 +10,8 @@ use crate::{
app::App,
clock::RequestedAt,
error::{Internal, Unauthorized},
- login::{app::ValidateError, Login},
- token,
+ login::Login,
+ token::{self, app::ValidateError},
};
#[derive(Clone, Debug)]
@@ -40,7 +40,7 @@ impl FromRequestParts<App> for Identity {
let secret = identity_token.secret().ok_or(LoginError::Unauthorized)?;
let app = State::<App>::from_request_parts(parts, state).await?;
- match app.logins().validate(&secret, &used_at).await {
+ match app.tokens().validate(&secret, &used_at).await {
Ok((token, login)) => Ok(Identity { token, login }),
Err(ValidateError::InvalidToken) => Err(LoginError::Unauthorized),
Err(other) => Err(other.into()),