Bump: 0.5.1 : persistent session cookie

This commit is contained in:
2026-08-16 15:06:55 +01:00
parent 0c6705badd
commit 80368b3ea5
3 changed files with 16 additions and 14 deletions
Generated
+2 -1
View File
@@ -2906,7 +2906,7 @@ dependencies = [
[[package]]
name = "server"
version = "0.4.0"
version = "0.5.1"
dependencies = [
"argon2",
"async-broadcast",
@@ -2930,6 +2930,7 @@ dependencies = [
"symphonia",
"sysinfo",
"thiserror 2.0.18",
"time",
"tokio",
"tower-http",
"tracing",
+2 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "server"
version = "0.5.0"
version = "0.5.1"
edition = "2024"
[target.x86_64-unknown-linux-gnu]
@@ -35,6 +35,7 @@ symphonia = { version = "0.5", features = ["aac"] }
opus = "0.3.1"
rubato = "3.0.0"
chrono = "0.4.45"
time = "0.3"
regex = "1"
thiserror = "2.0.18"
sysinfo = "0.36"
+10 -10
View File
@@ -375,19 +375,19 @@ where
fn cookie_for_token(token: &str, dev: bool) -> Cookie<'static> {
let token = token.to_owned();
match dev {
true => Cookie::build(("session", token))
let mut cookie = Cookie::build(("session", token))
.path("/")
.http_only(true)
.same_site(axum_extra::extract::cookie::SameSite::None)
.build(),
false => Cookie::build(("session", token))
.path("/")
.http_only(true)
// .max_age(Duration::from_hours(999999))
.same_site(axum_extra::extract::cookie::SameSite::Lax)
.build(),
.max_age(time::Duration::days(30))
.same_site(if dev {
axum_extra::extract::cookie::SameSite::None
} else {
axum_extra::extract::cookie::SameSite::Lax
});
if dev {
cookie = cookie.secure(true);
}
cookie.build()
}
#[axum::debug_handler]