fix login
Some checks failed
ci/woodpecker/push/build Pipeline failed

This commit is contained in:
JMARyA 2024-12-18 20:37:12 +01:00
parent c029fbd29a
commit 00717df95f
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
2 changed files with 3 additions and 2 deletions

View file

@ -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

View file

@ -33,7 +33,7 @@ pub async fn login_post(login_form: Form<LoginForm>, 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 its 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)