로그아웃 버튼 및 로직 추가
This commit is contained in:
@@ -66,6 +66,9 @@
|
||||
<button id="btn-open-guide-header" class="btn btn-outline" title="프로세스 가이드">
|
||||
<i data-lucide="book-open"></i> 가이드
|
||||
</button>
|
||||
<button id="btn-logout-header" class="btn btn-outline btn-sm" title="로그아웃">
|
||||
로그아웃
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
18
src/main.ts
18
src/main.ts
@@ -118,6 +118,19 @@ async function refreshAllData() {
|
||||
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 ---
|
||||
function initApp() {
|
||||
const mainContent = document.getElementById('main-content')!;
|
||||
@@ -200,6 +213,11 @@ function initApp() {
|
||||
pcFlowModal.open();
|
||||
return;
|
||||
}
|
||||
|
||||
if (target.closest('#btn-logout-header')) {
|
||||
logoutAndReturnToLogin();
|
||||
return;
|
||||
}
|
||||
});
|
||||
|
||||
createIcons({
|
||||
|
||||
Reference in New Issue
Block a user