From 22c37da738acb63333948b8b214da2614aa4e741 Mon Sep 17 00:00:00 2001 From: SDI Date: Wed, 1 Jul 2026 14:46:35 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=95=84=EC=9B=83=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EB=B0=8F=20=EB=A1=9C=EC=A7=81=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 3 +++ src/main.ts | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/index.html b/index.html index a1f4b33..7439a27 100644 --- a/index.html +++ b/index.html @@ -66,6 +66,9 @@ + diff --git a/src/main.ts b/src/main.ts index 1822703..648c059 100644 --- a/src/main.ts +++ b/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({