public void MarkUserAsLoggedOut()
        {
            _sessionStorageService.RemoveItemAsync("emailAddress");
            _sessionStorageService.RemoveItemAsync("token");

            var identity = new System.Security.Claims.ClaimsIdentity();

            var user = new System.Security.Claims.ClaimsPrincipal(identity);

            NotifyAuthenticationStateChanged(System.Threading.Tasks.Task
                                             .FromResult(new Microsoft.AspNetCore.Components.Authorization.AuthenticationState(user)));
        }
示例#2
0
        private async Task ClearToken()
        {
            await _sessionStorage.RemoveItemAsync("Token");

            await _localStorage.RemoveItemAsync("Token");

            loggedIn = false;
        }