From e9c970422ae3a0b2fa80bf0635adf0ab18838085 Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Wed, 8 Jul 2026 15:58:49 +0900 Subject: [PATCH] =?UTF-8?q?WASM=20=EB=B6=80=ED=8C=85=20=EC=98=A4=EB=A5=98?= =?UTF-8?q?=20=EB=94=94=EB=B2=84=EA=B9=85:=20=EC=83=81=EC=84=B8=20?= =?UTF-8?q?=EB=A1=9C=EA=B9=85=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 변경사항 - CustomAuthenticationStateProvider: 예외 로깅 강화 - GetAuthenticationStateAsync: 예외 타입, 메시지, 스택 트레이스 로깅 - ValidateTokenWithoutDb: 토큰 검증 성공/실패 상세 로깅 - 토큰 비어있음 체크 추가 ## 목적 WASM 부팅 단계에서 발생하는 예외의 정확한 원인 파악 ## 다음 단계 1. 상세 로그로 예외 원인 확인 2. 원인에 따라 수정 (API 호출 실패, 토큰 검증 오류 등) 3. WASM 부팅 성공 검증 Co-Authored-By: Claude Haiku 4.5 --- .../Services/CustomAuthenticationStateProvider.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/TaxBaik.Web.Client/Components/Admin/Services/CustomAuthenticationStateProvider.cs b/src/TaxBaik.Web.Client/Components/Admin/Services/CustomAuthenticationStateProvider.cs index 6db091b..80c9265 100644 --- a/src/TaxBaik.Web.Client/Components/Admin/Services/CustomAuthenticationStateProvider.cs +++ b/src/TaxBaik.Web.Client/Components/Admin/Services/CustomAuthenticationStateProvider.cs @@ -71,7 +71,8 @@ public class CustomAuthenticationStateProvider : AuthenticationStateProvider } catch (Exception ex) { - _logger.LogError(ex, "인증 상태 조회 중 오류 발생"); + _logger.LogError(ex, "❌ 인증 상태 조회 중 오류 발생: {ExceptionType} - {Message} - {StackTrace}", + ex.GetType().Name, ex.Message, ex.StackTrace); return new AuthenticationState(new ClaimsPrincipal(new ClaimsIdentity())); } } @@ -80,13 +81,21 @@ public class CustomAuthenticationStateProvider : AuthenticationStateProvider { try { + if (string.IsNullOrEmpty(token)) + { + _logger.LogWarning("❌ 토큰이 비어있습니다"); + return null; + } + var handler = new JwtSecurityTokenHandler(); var jwtToken = handler.ReadJwtToken(token); var identity = new ClaimsIdentity(jwtToken.Claims, "jwt"); + _logger.LogInformation("✅ 토큰 검증 성공: {Claims} claims", jwtToken.Claims.Count()); return new ClaimsPrincipal(identity); } - catch + catch (Exception ex) { + _logger.LogError(ex, "❌ 토큰 검증 실패: {ExceptionType} - {Message}", ex.GetType().Name, ex.Message); return null; } }