From 46878ea5a87a49299118dae41c99c0f0dca2e520 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Thu, 20 Feb 2025 17:46:10 +0100 Subject: [PATCH] Bugfix/improve error handling in http response interceptor (#4338) * Improve error handling * Update changelog --- CHANGELOG.md | 1 + apps/client/src/app/core/http-response.interceptor.ts | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6580eb33..b8020def5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Improved the error handling in the `HttpResponseInterceptor` - Added missing assets in _Storybook_ setup ## 2.139.1 - 2025-02-15 diff --git a/apps/client/src/app/core/http-response.interceptor.ts b/apps/client/src/app/core/http-response.interceptor.ts index 018e441fc..62c3540f7 100644 --- a/apps/client/src/app/core/http-response.interceptor.ts +++ b/apps/client/src/app/core/http-response.interceptor.ts @@ -108,10 +108,12 @@ export class HttpResponseInterceptor implements HttpInterceptor { }); } } else if (error.status === StatusCodes.UNAUTHORIZED) { - if (this.webAuthnService.isEnabled()) { - this.router.navigate(['/webauthn']); - } else if (!error.url.includes('/data-providers/ghostfolio/status')) { - this.tokenStorageService.signOut(); + if (!error.url.includes('/data-providers/ghostfolio/status')) { + if (this.webAuthnService.isEnabled()) { + this.router.navigate(['/webauthn']); + } else { + this.tokenStorageService.signOut(); + } } }