From 0f116a6a8998b365b28b6b511a51dd0230df8cf6 Mon Sep 17 00:00:00 2001 From: Toaster2 Date: Sat, 14 Feb 2026 12:55:22 +0100 Subject: [PATCH 1/3] Only reset token if /refreshToken returns 403 and a RefreshApiError --- src/app/api/authentication.service.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/app/api/authentication.service.ts b/src/app/api/authentication.service.ts index c15c34af..8325317b 100644 --- a/src/app/api/authentication.service.ts +++ b/src/app/api/authentication.service.ts @@ -73,11 +73,16 @@ export class AuthenticationService extends ApiImplementation { this.http.post("/refreshToken", request).subscribe({ error: error => { - this.ResetStoredInformation(); const apiError: RefreshApiError | undefined = error.error?.error; - console.warn("API error during token refresh:", apiError); - this.bannerService.warn("Session Expired", "Your session has expired, please sign in again."); + + if (apiError !== undefined && apiError.statusCode == 403) { + this.ResetStoredInformation(); + this.bannerService.warn("Session Expired", "Your session has expired, please sign in again."); + } + else { + this.bannerService.warn("Failed to refresh session", "An unknown error occured, your token was not reset: " + (apiError === undefined ? error.message : apiError.message)); + } }, next: response => { this.tokenStorage.SetStoredGameToken(response.tokenData); From f99a56f2bdc96071363d9f829735cc168dff5c73 Mon Sep 17 00:00:00 2001 From: Toaster2 Date: Sat, 14 Feb 2026 13:05:00 +0100 Subject: [PATCH 2/3] Clearer error message --- src/app/api/authentication.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/api/authentication.service.ts b/src/app/api/authentication.service.ts index 8325317b..5484344d 100644 --- a/src/app/api/authentication.service.ts +++ b/src/app/api/authentication.service.ts @@ -81,7 +81,7 @@ export class AuthenticationService extends ApiImplementation { this.bannerService.warn("Session Expired", "Your session has expired, please sign in again."); } else { - this.bannerService.warn("Failed to refresh session", "An unknown error occured, your token was not reset: " + (apiError === undefined ? error.message : apiError.message)); + this.bannerService.warn("Failed to refresh session", "An unknown error occured (but you are still signed in): " + (apiError === undefined ? error.message : apiError.message)); } }, next: response => { From 8fd25c37d9eb5d7829b273c868c8038a227c32b8 Mon Sep 17 00:00:00 2001 From: Toaster2 Date: Sat, 14 Feb 2026 13:16:29 +0100 Subject: [PATCH 3/3] Fix typo --- src/app/api/authentication.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/api/authentication.service.ts b/src/app/api/authentication.service.ts index 5484344d..e2b56e85 100644 --- a/src/app/api/authentication.service.ts +++ b/src/app/api/authentication.service.ts @@ -81,7 +81,7 @@ export class AuthenticationService extends ApiImplementation { this.bannerService.warn("Session Expired", "Your session has expired, please sign in again."); } else { - this.bannerService.warn("Failed to refresh session", "An unknown error occured (but you are still signed in): " + (apiError === undefined ? error.message : apiError.message)); + this.bannerService.warn("Failed to refresh session", "An unknown error occurred (but you are still signed in): " + (apiError === undefined ? error.message : apiError.message)); } }, next: response => {