fix(dashboard): 토큰 전달 방식 수정 — tkfb-core.js getToken() 활용
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -48,9 +48,10 @@ function escHtml(s) { const d = document.createElement('div'); d.textContent = s
|
|||||||
async function initDashboard() {
|
async function initDashboard() {
|
||||||
showSkeleton();
|
showSkeleton();
|
||||||
try {
|
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', {
|
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);
|
if (!resp.ok) throw new Error('API 오류: ' + resp.status);
|
||||||
const result = await resp.json();
|
const result = await resp.json();
|
||||||
|
|||||||
Reference in New Issue
Block a user