mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 18:48:11 +00:00
feat(freight:backoffice): migrated smart-office user-management
This commit is contained in:
@@ -125,8 +125,15 @@ export const AuthProvider = ({ children }: { children: ReactNode }) => {
|
||||
mfaEmailRef.current = null;
|
||||
},
|
||||
logout: () => {
|
||||
const preservedTheme = window.localStorage.getItem("edr-theme");
|
||||
|
||||
clearSessionCookies();
|
||||
localStorage.clear();
|
||||
window.localStorage.clear();
|
||||
|
||||
if (preservedTheme === "dark" || preservedTheme === "light") {
|
||||
window.localStorage.setItem("edr-theme", preservedTheme);
|
||||
}
|
||||
|
||||
setUser(null);
|
||||
window.location.replace("/auth");
|
||||
},
|
||||
|
||||
@@ -1,11 +1,47 @@
|
||||
interface LocaleText {
|
||||
en?: string;
|
||||
am?: string;
|
||||
}
|
||||
|
||||
interface AuthRole {
|
||||
id?: string;
|
||||
key?: string;
|
||||
}
|
||||
|
||||
interface AuthPermission {
|
||||
id?: string;
|
||||
key?: string;
|
||||
}
|
||||
|
||||
interface AuthEmployeePosition {
|
||||
id?: string;
|
||||
employeePositionId?: string;
|
||||
name?: LocaleText;
|
||||
key?: string;
|
||||
isDelegate?: boolean;
|
||||
parentPositionId?: string | null;
|
||||
permissions?: AuthPermission[];
|
||||
}
|
||||
|
||||
interface AuthEmployeeRecord {
|
||||
id?: string;
|
||||
organizationId?: string;
|
||||
unitId?: string;
|
||||
name?: LocaleText;
|
||||
positions?: AuthEmployeePosition[];
|
||||
}
|
||||
|
||||
export interface AuthUser {
|
||||
id?: string;
|
||||
email?: string;
|
||||
username?: string;
|
||||
name?: {
|
||||
en?: string;
|
||||
am?: string;
|
||||
};
|
||||
phoneNumber?: string;
|
||||
name?: LocaleText;
|
||||
roles?: AuthRole[];
|
||||
permissions?: AuthPermission[];
|
||||
employee?: AuthEmployeeRecord[];
|
||||
hasSetPassword?: boolean;
|
||||
status?: string;
|
||||
}
|
||||
|
||||
export interface AuthTokens {
|
||||
|
||||
Reference in New Issue
Block a user