fix: JWT 디코딩 시 한글 깨짐 수정 (atob → TextDecoder)

atob()가 UTF-8 멀티바이트 문자를 Latin-1로 처리하여 한글 이름이
깨지는 문제 수정. Uint8Array + TextDecoder 패턴으로 교체.
tkpurchase, tkuser nginx에 charset utf-8 추가.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-12 16:06:21 +09:00
parent 281f5d35d1
commit a195dd1d50
7 changed files with 11 additions and 6 deletions

View File

@@ -17,7 +17,7 @@ function getLoginUrl() {
if (h.includes('technicalkorea.net')) return location.protocol + '//tkfb.technicalkorea.net/login?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
return location.protocol + '//' + h + ':30000/login?redirect=' + encodeURIComponent(location.href) + '&_t=' + t;
}
function decodeToken(t) { try { return JSON.parse(atob(t.split('.')[1].replace(/-/g,'+').replace(/_/g,'/'))); } catch { return null; } }
function decodeToken(t) { try { const b = atob(t.split('.')[1].replace(/-/g,'+').replace(/_/g,'/')); return JSON.parse(new TextDecoder().decode(Uint8Array.from(b, c => c.charCodeAt(0)))); } catch { return null; } }
/* ===== 리다이렉트 루프 방지 ===== */
const _REDIRECT_KEY = '_sso_redirect_ts';