From 158a526aee708573cce1a55e868c331cb7c4a06e Mon Sep 17 00:00:00 2001 From: Leendert de Borst Date: Mon, 8 Jul 2024 16:45:05 +0200 Subject: [PATCH] Fix auth revoke token call (#74) --- .../Main/Pages/Sync/StatusMessages/Creating.razor | 8 ++++---- src/AliasVault.WebApp/Services/Auth/AuthService.cs | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/AliasVault.WebApp/Main/Pages/Sync/StatusMessages/Creating.razor b/src/AliasVault.WebApp/Main/Pages/Sync/StatusMessages/Creating.razor index 7c295c955..29e195731 100644 --- a/src/AliasVault.WebApp/Main/Pages/Sync/StatusMessages/Creating.razor +++ b/src/AliasVault.WebApp/Main/Pages/Sync/StatusMessages/Creating.razor @@ -3,11 +3,11 @@
- - - -
+ + + +

Welcome to AliasVault!

Your new encrypted vault is being created. This process may take a moment. Please wait. diff --git a/src/AliasVault.WebApp/Services/Auth/AuthService.cs b/src/AliasVault.WebApp/Services/Auth/AuthService.cs index c31061ede..d0dae03ef 100644 --- a/src/AliasVault.WebApp/Services/Auth/AuthService.cs +++ b/src/AliasVault.WebApp/Services/Auth/AuthService.cs @@ -163,19 +163,19 @@ public class AuthService(HttpClient httpClient, ILocalStorageService localStorag /// A representing the asynchronous operation. public async Task RemoveTokensAsync() { - await localStorage.RemoveItemAsync(AccessTokenKey); - await localStorage.RemoveItemAsync(RefreshTokenKey); - - // If the remote call fails we catch the exception and ignore it. - // This is because the user is already logged out and we don't want to trigger another refresh token request. + // Revoke the tokens from the server by calling the webapi. try { await RevokeTokenAsync(); } catch (Exception) { - // Ignore the exception + // If an exception occurs we ignore it and continue with removing the tokens from local storage. } + + // Remove the tokens from local storage. + await localStorage.RemoveItemAsync(AccessTokenKey); + await localStorage.RemoveItemAsync(RefreshTokenKey); } ///