diff options
author | metamuffin <metamuffin@disroot.org> | 2023-01-29 14:45:25 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-01-29 14:45:25 +0100 |
commit | de8d69d2886ae50e28da210fc690c99457a804bb (patch) | |
tree | b9d4fca9acd7d5fb844f4c76c8c338770d943df7 /server/src/routes/ui/account/mod.rs | |
parent | 0d9dc5672b0ba0c6c9988b0422837ceb00a5d7b8 (diff) | |
download | jellything-de8d69d2886ae50e28da210fc690c99457a804bb.tar jellything-de8d69d2886ae50e28da210fc690c99457a804bb.tar.bz2 jellything-de8d69d2886ae50e28da210fc690c99457a804bb.tar.zst |
more seeking code + expire cookies
Diffstat (limited to 'server/src/routes/ui/account/mod.rs')
-rw-r--r-- | server/src/routes/ui/account/mod.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/server/src/routes/ui/account/mod.rs b/server/src/routes/ui/account/mod.rs index e7031ff..63c01c5 100644 --- a/server/src/routes/ui/account/mod.rs +++ b/server/src/routes/ui/account/mod.rs @@ -6,6 +6,8 @@ pub mod admin; pub mod session; +use self::session::SessionCookie; + use super::{error::MyError, layout::LayoutPage}; use crate::{ database::{Database, User}, @@ -157,7 +159,14 @@ pub fn r_account_login_post( Err(anyhow!("invalid password"))? } - jar.add_private(Cookie::build("user", user.name).permanent().finish()); + jar.add_private( + Cookie::build( + "user", + serde_json::to_string(&SessionCookie::new(user.name)).unwrap(), + ) + .permanent() + .finish(), + ); Ok(Redirect::found(uri!(r_home()))) } |