diff --git a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyAuthenticationStateProvider.cs b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyAuthenticationStateProvider.cs index 37284a54a3..6a27b03ea7 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyAuthenticationStateProvider.cs +++ b/framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyAuthenticationStateProvider.cs @@ -16,6 +16,10 @@ using Microsoft.JSInterop; namespace Volo.Abp.AspNetCore.Components.WebAssembly; +/// +/// Blazor requests a new token each time it is initialized/refreshed. +/// This class is used to revoke a token that is no longer in use. +/// public class WebAssemblyAuthenticationStateProvider : RemoteAuthenticationService where TRemoteAuthenticationState : RemoteAuthenticationState where TProviderOptions : new() @@ -78,13 +82,6 @@ public class WebAssemblyAuthenticationStateProvider GetAuthenticationStateAsync() { - var state = await base.GetAuthenticationStateAsync(); - var applicationConfigurationDto = await WebAssemblyCachedApplicationConfigurationClient.GetAsync(); - if (state.User.Identity != null && state.User.Identity.IsAuthenticated && !applicationConfigurationDto.CurrentUser.IsAuthenticated) - { - await WebAssemblyCachedApplicationConfigurationClient.InitializeAsync(); - } - var accessToken = await FindAccessTokenAsync(); if (!accessToken.IsNullOrWhiteSpace()) { @@ -93,6 +90,13 @@ public class WebAssemblyAuthenticationStateProvider x.Value); var currentAccessToken = await FindAccessTokenAsync(); foreach (var accessToken in revokeAccessTokens) @@ -144,12 +149,18 @@ public class WebAssemblyAuthenticationStateProvider