This commit is contained in:
@@ -153,7 +153,6 @@ public class CustomAuthenticationStateProvider : AuthenticationStateProvider
|
||||
{
|
||||
// TokenStore 초기화
|
||||
_tokenStore.Clear();
|
||||
|
||||
NotifyAuthenticationStateChanged(GetAuthenticationStateAsync());
|
||||
}
|
||||
|
||||
|
||||
@@ -5,4 +5,5 @@ public interface ILocalStorageService
|
||||
Task<string?> GetItemAsStringAsync(string key);
|
||||
Task SetItemAsStringAsync(string key, string value);
|
||||
Task RemoveItemAsync(string key);
|
||||
Task ClearAuthAsync();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public class LocalStorageService : ILocalStorageService
|
||||
{
|
||||
try
|
||||
{
|
||||
return await _jsRuntime.InvokeAsync<string>("localStorage.getItem", key);
|
||||
return await _jsRuntime.InvokeAsync<string>("taxbaikAdminSession.getLocalStorageItem", key);
|
||||
}
|
||||
catch
|
||||
{
|
||||
@@ -27,7 +27,7 @@ public class LocalStorageService : ILocalStorageService
|
||||
{
|
||||
try
|
||||
{
|
||||
await _jsRuntime.InvokeVoidAsync("localStorage.setItem", key, value);
|
||||
await _jsRuntime.InvokeVoidAsync("taxbaikAdminSession.setLocalStorageItem", key, value);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
@@ -36,7 +36,20 @@ public class LocalStorageService : ILocalStorageService
|
||||
{
|
||||
try
|
||||
{
|
||||
await _jsRuntime.InvokeVoidAsync("localStorage.removeItem", key);
|
||||
await _jsRuntime.InvokeVoidAsync("taxbaikAdminSession.removeLocalStorageItem", key);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
public async Task ClearAuthAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
await RemoveItemAsync("accessToken");
|
||||
await RemoveItemAsync("refreshToken");
|
||||
await RemoveItemAsync("tokenExpiry");
|
||||
await RemoveItemAsync("auth_token");
|
||||
await RemoveItemAsync("admin-remembered-username");
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user