diff options
Diffstat (limited to 'src/routes/login.rs')
-rw-r--r-- | src/routes/login.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/routes/login.rs b/src/routes/login.rs index 67f8422..8843bd5 100644 --- a/src/routes/login.rs +++ b/src/routes/login.rs @@ -7,12 +7,13 @@ use serde::Deserialize; use crate::{ error::AuthError, - jwt::Claims, model::{LoginSchema, UserSchema}, state::AppState, Error, }; +use super::jwt::Claims; + #[derive(Debug, Deserialize, TypedPath)] #[typed_path("/api/login")] pub struct Login; @@ -40,7 +41,7 @@ impl Login { Argon2::default() .verify_password(password.as_bytes(), &PasswordHash::new(&password_hash)?)?; - let token = Claims::new(uuid, state.jwt_max_age).encode(state.jwt_secret.as_ref())?; + let token = Claims::from(uuid).encode(state.jwt_secret.as_ref())?; Authorization::bearer(&token) .map(TypedHeader) |