feat: update navigation to use dynamic state in role selection and streamline logout process
This commit is contained in:
parent
643659a26c
commit
cd26e4bb83
|
|
@ -397,7 +397,7 @@ const UserDropdown: FC = function () {
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (typeof window === "object")
|
if (typeof window === "object")
|
||||||
navigate(
|
navigate(
|
||||||
`${process.env.NEXT_PUBLIC_API_PORTAL}/choose-roles?state=manpower`
|
`${process.env.NEXT_PUBLIC_API_PORTAL}/choose-roles?state=${process.env.NEXT_PUBLIC_NAME}`
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -727,14 +727,9 @@ const SidebarBetterTree: React.FC<TreeMenuProps> = ({
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
<div
|
<div
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
await api.delete(
|
|
||||||
process.env.NEXT_PUBLIC_BASE_URL +
|
|
||||||
"/api/destroy-cookies"
|
|
||||||
);
|
|
||||||
localStorage.removeItem("user");
|
|
||||||
if (typeof window === "object")
|
if (typeof window === "object")
|
||||||
navigate(
|
navigate(
|
||||||
`${process.env.NEXT_PUBLIC_API_PORTAL}/logout`
|
`${process.env.NEXT_PUBLIC_API_PORTAL}/choose-roles?state=${process.env.NEXT_PUBLIC_NAME}`
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
className="cursor-pointer px-4 py-2 flex border-y hover:bg-gray-100 dark:border-gray-600 dark:hover:bg-gray-600"
|
className="cursor-pointer px-4 py-2 flex border-y hover:bg-gray-100 dark:border-gray-600 dark:hover:bg-gray-600"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue