diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2024-10-02 01:02:58 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2024-10-02 01:02:58 -0400 |
| commit | 5d3392799f88c5a3d3f9c656c73d6e8ac5c4d793 (patch) | |
| tree | 426c568d82b67a98095d25952d2b5b2345a6545b /src/token/extract/identity.rs | |
| parent | 357116366c1307bedaac6a3dfe9c5ed8e0e0c210 (diff) | |
Split login and token handling.
Diffstat (limited to 'src/token/extract/identity.rs')
| -rw-r--r-- | src/token/extract/identity.rs | 6 |
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()), |
