Skip to content

Commit

Permalink
Merge pull request #306 from rupato-deriv/Remove-query-param-on-logout
Browse files Browse the repository at this point in the history
fix: remove query param on logout
  • Loading branch information
rupato-deriv authored Mar 6, 2025
2 parents a32c0cd + 1062250 commit 6d27e75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/app/CoreStoreProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ const CoreStoreProvider: React.FC<{ children: React.ReactNode }> = observer(({ c
error?.code === 'InvalidToken'
) {
await oAuthLogout();
if (sessionStorage.getItem('query_param_currency')) {
sessionStorage.removeItem('query_param_currency');
}
}

if (msg_type === 'balance' && data && !error) {
Expand Down
3 changes: 3 additions & 0 deletions src/hooks/auth/useOauth2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export const useOauth2 = ({
const logoutHandler = async () => {
client?.setIsLoggingOut(true);
await oAuthLogout();
if (sessionStorage.getItem('query_param_currency')) {
sessionStorage.removeItem('query_param_currency');
}
};

return { isOAuth2Enabled, oAuthLogout: logoutHandler };
Expand Down

0 comments on commit 6d27e75

Please sign in to comment.