fix proper loggedin_user cookie after setting pw
This commit is contained in:
parent
3e327e98f1
commit
fa3ab3ec8a
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user