Skip to content

Commit

Permalink
fix: oidc issues
Browse files Browse the repository at this point in the history
  • Loading branch information
rupato-deriv committed Feb 27, 2025
1 parent 58fe852 commit 92bae87
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/pages/callback/callback-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,13 @@ const CallbackPage = () => {
localStorage.setItem('active_loginid', tokens.acct1);
}

const client_accounts = JSON.parse(localStorage.getItem('clientAccounts') || '{}');
const currency = sessionStorage.getItem('query_param_currency');
window.location.assign(state && state?.account ? state?.account : `/?account=${currency || 'USD'}`);

const is_valid_currency = currency && Object.prototype.hasOwnProperty.call(client_accounts, currency);

const selected_currency = is_valid_currency ? currency : 'USD';
window.location.assign(`/?account=${selected_currency}`);
}}
renderReturnButton={() => {
return (
Expand Down

0 comments on commit 92bae87

Please sign in to comment.