Skip to content

Commit

Permalink
Fix logout in deployed environments (#1390) (#1392)
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Peels <[email protected]>
  • Loading branch information
mpeels and Michael Peels authored May 14, 2024
1 parent 82603c0 commit c704579
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion apps/modernization-ui/src/logout/logout.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@
}
}
}

6 changes: 1 addition & 5 deletions apps/modernization-ui/src/providers/UserContext.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, { ReactNode, useEffect, useReducer } from 'react';

import { Config } from 'config';
import { User } from 'user';

type InternalState = { status: 'waiting' } | { status: 'ready'; user: User } | { status: 'logout' };
Expand Down Expand Up @@ -49,10 +48,7 @@ const UserContextProvider = ({ initial, children }: Props) => {
// delete cookies
document.cookie = 'nbs_user=; Max-Age=0; path=/;';
document.cookie = 'nbs_token=; Max-Age=0; path=/;';
if (Config.enableLogin) {
// loading external page will clear state
window.location.href = '/nbs/logout';
}
window.location.href = '/nbs/logout';
}
}, [dispatch, state.status]);

Expand Down
1 change: 1 addition & 0 deletions apps/modernization-ui/src/shared/header/NavBar.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
font-size: 10pt;
font-family: Arial, sans-serif;
padding: 0.15em;
cursor: pointer;
&:focus {
background-color: $classic-active-navigation-item-background;
color: $classic-active-navigation-item-color;
Expand Down

0 comments on commit c704579

Please sign in to comment.