parent
c029fbd29a
commit
00717df95f
2 changed files with 3 additions and 2 deletions
|
@ -1,9 +1,10 @@
|
||||||
FROM rust:buster as builder
|
FROM rust:buster as builder
|
||||||
|
|
||||||
|
RUN rustup default nightly
|
||||||
|
|
||||||
COPY . /app
|
COPY . /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN rustup default nightly
|
|
||||||
RUN cargo build --release
|
RUN cargo build --release
|
||||||
|
|
||||||
FROM debian:buster
|
FROM debian:buster
|
||||||
|
|
|
@ -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, _) = 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
|
.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
|
.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)
|
.max_age(rocket::time::Duration::days(7)) // Set the cookie expiration (7 days in this case)
|
||||||
|
|
Loading…
Add table
Reference in a new issue