diff options
| author | Owen Jacobson <owen@grimoire.ca> | 2025-04-03 23:45:23 -0400 |
|---|---|---|
| committer | Owen Jacobson <owen@grimoire.ca> | 2025-04-03 23:45:23 -0400 |
| commit | 9f7f82dbd9adee8ae18ae7ff2600b3e1dc8fadbc (patch) | |
| tree | d973d00486ffab3445e3ca454e93a941ed8fe6e2 /src/token/extract/identity.rs | |
| parent | 24755a89a97a4d1cb10ebbcf41e200861f3bedf3 (diff) | |
| parent | 45eea07a56022f647b3a273798a5255cda73f13d (diff) | |
Merge branch 'prop/rename-login-to-user'
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 acfd7ae..d1c0334 100644 --- a/src/token/extract/identity.rs +++ b/src/token/extract/identity.rs @@ -10,14 +10,14 @@ use crate::{ app::App, clock::RequestedAt, error::{Internal, Unauthorized}, - login::Login, token::{self, app::ValidateError}, + user::User, }; #[derive(Clone, Debug)] pub struct Identity { pub token: token::Id, - pub login: Login, + pub user: User, } impl FromRequestParts<App> for Identity { @@ -31,7 +31,7 @@ impl FromRequestParts<App> for Identity { let app = State::<App>::from_request_parts(parts, state).await?; match app.tokens().validate(&secret, &used_at).await { - Ok((token, login)) => Ok(Identity { token, login }), + Ok((token, user)) => Ok(Identity { token, user }), Err(ValidateError::InvalidToken) => Err(LoginError::Unauthorized), Err(other) => Err(other.into()), } |
