From 659e8e05e5b89dac4a5fd636627eba826a99eb5d Mon Sep 17 00:00:00 2001 From: Ho Ngoc Hai Date: Sat, 14 Mar 2026 07:24:08 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20POS=20settings=20button=20navigates=20by?= =?UTF-8?q?=20role=20=E2=80=94=20staff=E2=86=92/staff,=20admin=E2=86=92/ad?= =?UTF-8?q?min?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PosLayout.razor hardcoded navigation to /admin for the settings button and sidebar link, causing staff users to land on the admin page. Now uses AuthStateService.GetPortalUrl() for role-aware routing. Co-Authored-By: Claude Opus 4.6 --- .../src/WebClientTpos.Client/Layout/PosLayout.razor | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/apps/web-client-tpos-net/src/WebClientTpos.Client/Layout/PosLayout.razor b/apps/web-client-tpos-net/src/WebClientTpos.Client/Layout/PosLayout.razor index 4dc8eea1..4a2a3e42 100644 --- a/apps/web-client-tpos-net/src/WebClientTpos.Client/Layout/PosLayout.razor +++ b/apps/web-client-tpos-net/src/WebClientTpos.Client/Layout/PosLayout.razor @@ -11,6 +11,7 @@ @inject NavigationManager NavigationManager @inject WebClientTpos.Client.Services.PosDataService DataService @inject IJSRuntime JS +@inject WebClientTpos.Client.Services.AuthStateService AuthState @@ -43,7 +44,7 @@ @_orderCount } - @@ -89,9 +90,9 @@ @@ -208,7 +209,7 @@ try { await JS.InvokeVoidAsync("lucide.createIcons"); } catch { } } - private void GoToAdmin() => NavigationManager.NavigateTo("/admin"); + private void GoToPortal() => NavigationManager.NavigateTo(AuthState.GetPortalUrl()); private void ToggleSidebar() => _sidebarOpen = !_sidebarOpen; private void CloseSidebar() => _sidebarOpen = false;