로그아웃 버튼 및 로직 추가
All checks were successful
ITAM Code Check / build-and-config-check (push) Successful in 12s
ITAM Docker Build Check / docker-build-check (push) Successful in 19s

This commit is contained in:
2026-07-01 14:46:35 +09:00
parent 054ba146bf
commit 22c37da738
2 changed files with 21 additions and 0 deletions

View File

@@ -66,6 +66,9 @@
<button id="btn-open-guide-header" class="btn btn-outline" title="프로세스 가이드"> <button id="btn-open-guide-header" class="btn btn-outline" title="프로세스 가이드">
<i data-lucide="book-open"></i> 가이드 <i data-lucide="book-open"></i> 가이드
</button> </button>
<button id="btn-logout-header" class="btn btn-outline btn-sm" title="로그아웃">
로그아웃
</button>
</div> </div>
</div> </div>
</header> </header>

View File

@@ -118,6 +118,19 @@ async function refreshAllData() {
refreshView(); refreshView();
} }
async function logoutAndReturnToLogin() {
try {
await fetch('/api/auth/logout', {
method: 'POST',
headers: { 'Content-Type': 'application/json' }
});
} catch (error) {
console.error('Logout failed:', error);
}
window.location.href = '/';
}
// --- App Initialization --- // --- App Initialization ---
function initApp() { function initApp() {
const mainContent = document.getElementById('main-content')!; const mainContent = document.getElementById('main-content')!;
@@ -200,6 +213,11 @@ function initApp() {
pcFlowModal.open(); pcFlowModal.open();
return; return;
} }
if (target.closest('#btn-logout-header')) {
logoutAndReturnToLogin();
return;
}
}); });
createIcons({ createIcons({