diff --git a/src/tera/auth.rs b/src/tera/auth.rs index bd121db..6ff2ddc 100644 --- a/src/tera/auth.rs +++ b/src/tera/auth.rs @@ -79,7 +79,7 @@ async fn login( } }; - cookies.add_private(Cookie::new("loggedin_user", format!("{}", json!(user.id)))); + cookies.add_private(Cookie::new("loggedin_user", format!("{}", user.id))); Log::create( db, @@ -128,8 +128,7 @@ async fn updatepw( user.update_pw(db, updatepw.password).await; - let user_json: String = format!("{}", json!(user)); - let mut cookie = Cookie::new("loggedin_user", user_json); + let mut cookie = Cookie::new("loggedin_user", format!("{}", user.id)); cookie.set_expires(OffsetDateTime::now_utc() + Duration::weeks(12)); cookies.add_private(cookie);