Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UIT-264: clear auth0 session on logout and remove login prompt #439

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/_context/AuthenticationContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const AuthenticationProvider: FC<PropsWithChildren> = ({ children }) => {
const logout = useCallback(async () => {
try {
await client.credentialsManager.clearCredentials();
await client.webAuth.clearSession();

// Clear react query cache
const queryCache = new QueryCache({});
Expand All @@ -61,7 +62,7 @@ const AuthenticationProvider: FC<PropsWithChildren> = ({ children }) => {
} catch (e) {
log.error(e);
}
}, [client.credentialsManager, setIsAuthenticated]);
}, [client.credentialsManager, client.webAuth, setIsAuthenticated]);

const checkAndRenewCredentials = useCallback(async () => {
if (!client) return;
Expand Down
1 change: 0 additions & 1 deletion src/login/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const Login = () => {
{
audience: Config.REACT_NATIVE_APP_AUTH0_AUDIENCE,
product_display_name: 'UiTPAS',
prompt: 'login',
referrer: 'uitpas',
scope: 'openid profile email offline_access',
},
Expand Down
Loading