aboutsummaryrefslogtreecommitdiff
path: root/src/handlers/auth.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/handlers/auth.rs')
-rw-r--r--src/handlers/auth.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/handlers/auth.rs b/src/handlers/auth.rs
index 7e2642c..c00fb8d 100644
--- a/src/handlers/auth.rs
+++ b/src/handlers/auth.rs
@@ -43,7 +43,9 @@ pub async fn login_post(Form(login): Form<LoginForm>, state: Extension<Arc<State
.execute(&mut conn)
.await?;
- let updated_jar = jar.add(Cookie::new("user-id", user.id.clone()));
+ let updated_jar = jar.add(Cookie::build("user-id", user.id.clone())
+ .path("/")
+ .finish());
Ok((updated_jar, Redirect::to("/")))
} else {