diff options
| author | Daniel Hader <[email protected]> | 2026-05-30 10:10:17 -0500 |
|---|---|---|
| committer | Daniel Hader <[email protected]> | 2026-05-30 10:10:17 -0500 |
| commit | 929be68e691c1c4015fc6874111b19b9f5d68c02 (patch) | |
| tree | ffc4ecb9c63d8dc242c33d69a592dc093dcfd122 /src/routes/auth.rs | |
| parent | 772c7844c4ca1de632f64eb9428e8e97eea64ac1 (diff) | |
registration page, me endpoint, and minor content tweaks
Diffstat (limited to 'src/routes/auth.rs')
| -rw-r--r-- | src/routes/auth.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/routes/auth.rs b/src/routes/auth.rs index 4fb9124..979e617 100644 --- a/src/routes/auth.rs +++ b/src/routes/auth.rs @@ -2,7 +2,7 @@ use std::time::{SystemTime, UNIX_EPOCH}; use axum::extract::{Json, State, FromRequestParts}; use axum::response::IntoResponse; -use axum::http::{StatusCode, request::Parts}; +use axum::http::{request::Parts}; use axum_extra::extract::CookieJar; use axum_extra::extract::cookie::{Cookie, SameSite}; use jsonwebtoken::{DecodingKey, EncodingKey, Header, Validation, decode, encode}; @@ -21,6 +21,7 @@ pub struct Claims { pub sub: String, pub exp: usize, pub iat: usize, + pub username: String, pub is_admin: bool, } @@ -92,6 +93,7 @@ pub async fn login( sub: user.email().to_string(), iat: now, exp: now + 60 * 60 * 24, + username: user.username().to_string(), is_admin: false }; |
