fix(portal:auth): auth portal redirect fixed

This commit is contained in:
Michael Abebe
2026-05-18 17:00:45 +03:00
parent 2478b0278b
commit 576841cc96
2 changed files with 9 additions and 4 deletions

View File

@@ -74,10 +74,14 @@ const App = () => {
const userEmail = user?.email;
const handleLogout = () => {
// Best-effort server-side session invalidation; local cleanup always runs
// so a failed API call (e.g. expired token) never leaves the user stuck.
logout();
["auth-token", "refresh-token"].forEach((name) => {
[
"auth-token",
"refresh-token",
"auth-user",
"current-position-id",
"selected-position-id",
].forEach((name) => {
document.cookie = `${name}=; Max-Age=0; path=/`;
});
localStorage.clear();
@@ -113,6 +117,7 @@ const App = () => {
path="/admin/dropdowns"
element={<DropdownSettingsPage />}
/>
<Route path="/user-management" element={<Navigate to="/" replace />} />
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
</DashboardLayout>

View File

@@ -50,7 +50,7 @@ window.__USER_MANAGEMENT_BRANDING__ = {
organizationName: "EDR Platform",
appName: "EDR Portal",
moduleBasePath: "/user-management",
backToAppPath: "/dashboard",
backToAppPath: "/",
backToAppLabel: "Back to dashboard",
};