From 00717df95fb3fd524d34bffc0cf1fe8cde17b340 Mon Sep 17 00:00:00 2001 From: JMARyA Date: Wed, 18 Dec 2024 20:37:12 +0100 Subject: [PATCH] fix login --- Dockerfile | 3 ++- src/pages/user.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 786bc3e..6326839 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,10 @@ FROM rust:buster as builder +RUN rustup default nightly + COPY . /app WORKDIR /app -RUN rustup default nightly RUN cargo build --release FROM debian:buster diff --git a/src/pages/user.rs b/src/pages/user.rs index ffb2967..5bab1db 100644 --- a/src/pages/user.rs +++ b/src/pages/user.rs @@ -33,7 +33,7 @@ pub async fn login_post(login_form: Form, cookies: &CookieJar<'_>) -> let (session, _) = User::login(&login_data.username, &login_data.password).await?; - let session_cookie = Cookie::build(("session", session.id.to_string())) + let session_cookie = Cookie::build(("session", session.token.to_string())) .path("/") // Set the cookie path to the root so it’s available for the whole app .http_only(true) // Make the cookie HTTP only for security .max_age(rocket::time::Duration::days(7)) // Set the cookie expiration (7 days in this case)