Bump: 0.5.1 : persistent session cookie
This commit is contained in:
Generated
+2
-1
@@ -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",
|
||||
|
||||
@@ -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"
|
||||
|
||||
+12
-12
@@ -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))
|
||||
.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(),
|
||||
let mut cookie = Cookie::build(("session", token))
|
||||
.path("/")
|
||||
.http_only(true)
|
||||
.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]
|
||||
|
||||
Reference in New Issue
Block a user