a039bb53a4
- AuthService로 JWT 토큰 생성 및 검증 - CustomAuthenticationStateProvider를 통한 Blazor 인증 통합 - LocalStorageService로 토큰 관리 - Login.razor 완전 재작성 (실제 DB 검증, 토큰 발급) - BCrypt 기반 비밀번호 검증 - admin/admin123으로 테스트 가능 Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
44 lines
924 B
C#
44 lines
924 B
C#
using Microsoft.JSInterop;
|
|
|
|
namespace TaxBaik.Admin.Services;
|
|
|
|
public class LocalStorageService : ILocalStorageService
|
|
{
|
|
private readonly IJSRuntime _jsRuntime;
|
|
|
|
public LocalStorageService(IJSRuntime jsRuntime)
|
|
{
|
|
_jsRuntime = jsRuntime;
|
|
}
|
|
|
|
public async Task<string?> GetItemAsStringAsync(string key)
|
|
{
|
|
try
|
|
{
|
|
return await _jsRuntime.InvokeAsync<string>("localStorage.getItem", key);
|
|
}
|
|
catch
|
|
{
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public async Task SetItemAsStringAsync(string key, string value)
|
|
{
|
|
try
|
|
{
|
|
await _jsRuntime.InvokeVoidAsync("localStorage.setItem", key, value);
|
|
}
|
|
catch { }
|
|
}
|
|
|
|
public async Task RemoveItemAsync(string key)
|
|
{
|
|
try
|
|
{
|
|
await _jsRuntime.InvokeVoidAsync("localStorage.removeItem", key);
|
|
}
|
|
catch { }
|
|
}
|
|
}
|