From ad48befb9ac84f269cdea8c6a326a0fced00493f Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Sun, 28 Jun 2026 12:58:27 +0900 Subject: [PATCH] fix: logout, accordion, and drawer interactivity issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Issues Fixed:** 1. ✅ Logout not working - Created Logout.razor page (was missing) - Properly calls AuthStateProvider.LogoutAsync() - Redirects to login page with forceLoad: true - Button click now triggers async logout flow 2. ✅ Accordion state not persisting - Changed MudNavGroup from fixed Expanded=true/false - to @bind-Expanded data binding - Now properly toggles between expanded/collapsed - State persists across clicks - Added expandedCustomerGroup, expandedWebsiteGroup properties 3. ✅ Drawer responsiveness - Already working with @bind-open="@drawerOpen" - ToggleDrawer() properly toggles state - Responsive behavior controlled via Breakpoint.Md **Implementation:** - Logout.razor: New page for async logout - Calls AuthStateProvider.LogoutAsync() - Clears TokenStore + localStorage - Redirects to /admin/login - MainLayout.razor: Accordion interactivity - @bind-Expanded replaces hardcoded Expanded properties - Each group has independent state variable - Click properly toggles group expansion Co-Authored-By: Claude Sonnet 4.6 --- .../Components/Admin/Layout/MainLayout.razor | 6 ++++-- TaxBaik.Web/Components/Admin/Pages/Logout.razor | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 TaxBaik.Web/Components/Admin/Pages/Logout.razor diff --git a/TaxBaik.Web/Components/Admin/Layout/MainLayout.razor b/TaxBaik.Web/Components/Admin/Layout/MainLayout.razor index f573f4c..29a67ee 100644 --- a/TaxBaik.Web/Components/Admin/Layout/MainLayout.razor +++ b/TaxBaik.Web/Components/Admin/Layout/MainLayout.razor @@ -42,11 +42,11 @@ 대시보드 - + 고객 카드 신고 일정 - + 공지사항 FAQ 관리 블로그 관리 @@ -70,6 +70,8 @@ @code { private bool drawerOpen = true; + private bool expandedCustomerGroup = true; + private bool expandedWebsiteGroup = false; private void ToggleDrawer() { diff --git a/TaxBaik.Web/Components/Admin/Pages/Logout.razor b/TaxBaik.Web/Components/Admin/Pages/Logout.razor new file mode 100644 index 0000000..5291301 --- /dev/null +++ b/TaxBaik.Web/Components/Admin/Pages/Logout.razor @@ -0,0 +1,17 @@ +@page "/admin/logout" +@using TaxBaik.Web.Services +@inject CustomAuthenticationStateProvider AuthStateProvider +@inject NavigationManager NavigationManager + +로그아웃 + +@code { + protected override async Task OnInitializedAsync() + { + // 사용자 로그아웃 + await AuthStateProvider.LogoutAsync(); + + // 로그인 페이지로 리다이렉트 + NavigationManager.NavigateTo("/taxbaik/admin/login", forceLoad: true); + } +}