fix(dashboard): 토큰 전달 방식 수정 — tkfb-core.js getToken() 활용

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-30 13:22:52 +09:00
parent 7aaac1e334
commit 295928c725

View File

@@ -48,9 +48,10 @@ function escHtml(s) { const d = document.createElement('div'); d.textContent = s
async function initDashboard() {
showSkeleton();
try {
const token = localStorage.getItem('sso_token') || getCookie('sso_token');
const token = typeof getToken === 'function' ? getToken() : (localStorage.getItem('sso_token') || getCookie('sso_token'));
if (!token) { showError('로그인이 필요합니다.'); return; }
const resp = await fetch('/api/dashboard/my-summary', {
headers: { 'Authorization': 'Bearer ' + token }
headers: { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json' }
});
if (!resp.ok) throw new Error('API 오류: ' + resp.status);
const result = await resp.json();