From 929be68e691c1c4015fc6874111b19b9f5d68c02 Mon Sep 17 00:00:00 2001 From: Daniel Hader Date: Sat, 30 May 2026 10:10:17 -0500 Subject: registration page, me endpoint, and minor content tweaks --- src/routes/auth.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/routes/auth.rs') 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 }; -- cgit v1.2.3