From 871d5109bfd0d4e6fb02ccadca4e84efdb37c7b5 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Sat, 31 Aug 2024 18:52:29 +0200 Subject: [PATCH] Fix authentication issue --- central_backend/Cargo.lock | 20 ++------------------ central_backend/Cargo.toml | 2 +- central_frontend/src/api/ApiClient.ts | 2 +- 3 files changed, 4 insertions(+), 20 deletions(-) diff --git a/central_backend/Cargo.lock b/central_backend/Cargo.lock index cd84641..0478c65 100644 --- a/central_backend/Cargo.lock +++ b/central_backend/Cargo.lock @@ -106,7 +106,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2c99b7a5614b72a78f04aa2021e5370fc1aef2475fffeffc0c1266b99007062" dependencies = [ "actix-service", - "actix-session 0.9.0", + "actix-session", "actix-utils", "actix-web", "derive_more", @@ -205,22 +205,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "actix-session" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac013ca53d36acb0cc60f5437381c97c291f51a12a5bd8d02febc3a3aaf53390" -dependencies = [ - "actix-service", - "actix-utils", - "actix-web", - "anyhow", - "derive_more", - "serde", - "serde_json", - "tracing", -] - [[package]] name = "actix-tls" version = "3.4.0" @@ -619,7 +603,7 @@ dependencies = [ "actix-cors", "actix-identity", "actix-remote-ip", - "actix-session 0.10.0", + "actix-session", "actix-web", "anyhow", "asn1", diff --git a/central_backend/Cargo.toml b/central_backend/Cargo.toml index e7da996..9ffe5be 100644 --- a/central_backend/Cargo.toml +++ b/central_backend/Cargo.toml @@ -23,7 +23,7 @@ serde_json = "1.0.123" rand = "0.8.5" actix = "0.13.5" actix-identity = "0.7.1" -actix-session = { version = "0.10.0", features = ["cookie-session"] } +actix-session = { version = "0.9.0", features = ["cookie-session"] } actix-cors = "0.7.0" actix-remote-ip = "0.1.0" futures-util = "0.3.30" diff --git a/central_frontend/src/api/ApiClient.ts b/central_frontend/src/api/ApiClient.ts index 213ddbc..177ac86 100644 --- a/central_frontend/src/api/ApiClient.ts +++ b/central_frontend/src/api/ApiClient.ts @@ -163,7 +163,7 @@ export class APIClient { // Handle expired tokens if (status === 412) { AuthApi.UnsetAuthenticated(); - window.location.href = import.meta.env.VITE_APP_BASENAME; + window.location.href = "/"; } if (!args.allowFail && (status < 200 || status > 299))