fix(tkeg): JWT 파싱 시 한글 이름 깨짐 수정 (UTF-8 디코딩)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-17 07:31:06 +09:00
parent 9a2b682b18
commit 0910f5d0a6

View File

@@ -23,7 +23,12 @@ function parseJwt(token) {
try {
const base64Url = token.split('.')[1];
const base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
return JSON.parse(atob(base64));
const jsonPayload = decodeURIComponent(
atob(base64).split('').map(c =>
'%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)
).join('')
);
return JSON.parse(jsonPayload);
} catch { return null; }
}