diff options
| author | Daniel Hader <[email protected]> | 2026-06-02 20:37:40 -0500 |
|---|---|---|
| committer | Daniel Hader <[email protected]> | 2026-06-02 20:37:40 -0500 |
| commit | 51fac3f3b6f73b649ba8109b37d8ff311b905cd4 (patch) | |
| tree | 4a2eb771842bf65ccb6e95c6c1d59ef65cbd2a7d /src/routes/auth.rs | |
| parent | 14a4d586b7c7abc86674724153757f15faf7262c (diff) | |
problem statement on submission page and submission logic tweaks
Diffstat (limited to 'src/routes/auth.rs')
| -rw-r--r-- | src/routes/auth.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/routes/auth.rs b/src/routes/auth.rs index ab7a393..8e8d99b 100644 --- a/src/routes/auth.rs +++ b/src/routes/auth.rs @@ -18,9 +18,10 @@ use crate::routes::errors::RouteError; #[derive(Serialize, Deserialize)] pub struct Claims { - pub sub: String, + pub sub: i64, pub exp: usize, pub iat: usize, + pub email: String, pub username: String, pub is_admin: bool, } @@ -90,9 +91,10 @@ pub async fn login( .as_secs() as usize; let claims = Claims { - sub: user.email().to_string(), + sub: user.id(), iat: now, exp: now + 60 * 60 * 24, + email: user.email().to_string(), username: user.username().to_string(), is_admin: false }; |
