mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-29 07:11:00 +00:00
update the usermanagement link
This commit is contained in:
@@ -19,7 +19,7 @@ import { useNavigate, useLocation } from 'react-router-dom';
|
||||
|
||||
function readToken(): string | null {
|
||||
return (
|
||||
localStorage.getItem('fhc-backoffice-auth-token') ??
|
||||
localStorage.getItem('ema-backoffice-auth-token') ??
|
||||
(() => {
|
||||
const escaped = 'auth-token'.replace(/([.$?*|{}()[\]\\/+^])/g, '\\$1');
|
||||
const match = document.cookie.match(new RegExp('(?:^|; )' + escaped + '=([^;]*)'));
|
||||
@@ -29,7 +29,7 @@ function readToken(): string | null {
|
||||
}
|
||||
|
||||
function readRefreshToken(): string | null {
|
||||
return localStorage.getItem('fhc-backoffice-auth-refresh-token') ?? null;
|
||||
return localStorage.getItem('ema-backoffice-refresh-token') ?? null;
|
||||
}
|
||||
|
||||
export default function UserManagementHostPage() {
|
||||
@@ -68,6 +68,14 @@ export default function UserManagementHostPage() {
|
||||
}
|
||||
|
||||
if (data.type === 'UM_ROUTE_CHANGED' && typeof data.path === 'string') {
|
||||
// Allow the module to navigate the host away by using /return/<path>.
|
||||
// Add a nav item with href: "/return/dashboard" in project.theme.ts
|
||||
// navItems to send the user back to the host app.
|
||||
const returnMatch = data.path.match(/^\/return\/(.+)/);
|
||||
if (returnMatch) {
|
||||
navigate('/' + returnMatch[1], { replace: true });
|
||||
return;
|
||||
}
|
||||
const target = '/um' + data.path;
|
||||
if (window.location.pathname + window.location.search !== target) {
|
||||
navigate(target, { replace: true });
|
||||
|
||||
Reference in New Issue
Block a user