summaryrefslogtreecommitdiff
path: root/src/token/extract
diff options
context:
space:
mode:
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 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()),
}