Bump: 0.5.1 : persistent session cookie
This commit is contained in:
Generated
+2
-1
@@ -2906,7 +2906,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "server"
|
name = "server"
|
||||||
version = "0.4.0"
|
version = "0.5.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"argon2",
|
"argon2",
|
||||||
"async-broadcast",
|
"async-broadcast",
|
||||||
@@ -2930,6 +2930,7 @@ dependencies = [
|
|||||||
"symphonia",
|
"symphonia",
|
||||||
"sysinfo",
|
"sysinfo",
|
||||||
"thiserror 2.0.18",
|
"thiserror 2.0.18",
|
||||||
|
"time",
|
||||||
"tokio",
|
"tokio",
|
||||||
"tower-http",
|
"tower-http",
|
||||||
"tracing",
|
"tracing",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "server"
|
name = "server"
|
||||||
version = "0.5.0"
|
version = "0.5.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[target.x86_64-unknown-linux-gnu]
|
[target.x86_64-unknown-linux-gnu]
|
||||||
@@ -35,6 +35,7 @@ symphonia = { version = "0.5", features = ["aac"] }
|
|||||||
opus = "0.3.1"
|
opus = "0.3.1"
|
||||||
rubato = "3.0.0"
|
rubato = "3.0.0"
|
||||||
chrono = "0.4.45"
|
chrono = "0.4.45"
|
||||||
|
time = "0.3"
|
||||||
regex = "1"
|
regex = "1"
|
||||||
thiserror = "2.0.18"
|
thiserror = "2.0.18"
|
||||||
sysinfo = "0.36"
|
sysinfo = "0.36"
|
||||||
|
|||||||
+10
-10
@@ -375,19 +375,19 @@ where
|
|||||||
|
|
||||||
fn cookie_for_token(token: &str, dev: bool) -> Cookie<'static> {
|
fn cookie_for_token(token: &str, dev: bool) -> Cookie<'static> {
|
||||||
let token = token.to_owned();
|
let token = token.to_owned();
|
||||||
match dev {
|
let mut cookie = Cookie::build(("session", token))
|
||||||
true => Cookie::build(("session", token))
|
|
||||||
.path("/")
|
.path("/")
|
||||||
.http_only(true)
|
.http_only(true)
|
||||||
.same_site(axum_extra::extract::cookie::SameSite::None)
|
.max_age(time::Duration::days(30))
|
||||||
.build(),
|
.same_site(if dev {
|
||||||
false => Cookie::build(("session", token))
|
axum_extra::extract::cookie::SameSite::None
|
||||||
.path("/")
|
} else {
|
||||||
.http_only(true)
|
axum_extra::extract::cookie::SameSite::Lax
|
||||||
// .max_age(Duration::from_hours(999999))
|
});
|
||||||
.same_site(axum_extra::extract::cookie::SameSite::Lax)
|
if dev {
|
||||||
.build(),
|
cookie = cookie.secure(true);
|
||||||
}
|
}
|
||||||
|
cookie.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[axum::debug_handler]
|
#[axum::debug_handler]
|
||||||
|
|||||||
Reference in New Issue
Block a user