Skip to content

Commit 8bdbedc

Browse files
authored
Merge pull request #237 from farabi-deriv/farabi/webrel-3608/account-currency-param-not-set
Farabi/webrel-3608/account-currency-param-not-set
2 parents e72e35e + 9d28293 commit 8bdbedc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/pages/callback/callback-page.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const CallbackPage = () => {
66
<Callback
77
onSignInSuccess={(tokens: Record<string, string>) => {
88
const accountsList: Record<string, string> = {};
9-
const clientAccounts: Record<string, { loginid: string; token: string }> = {};
9+
const clientAccounts: Record<string, { loginid: string; token: string; currency: string }> = {};
1010

1111
for (const [key, value] of Object.entries(tokens)) {
1212
if (key.startsWith('acct')) {
@@ -16,8 +16,14 @@ const CallbackPage = () => {
1616
clientAccounts[value] = {
1717
loginid: value,
1818
token: tokens[tokenKey],
19+
currency: '',
1920
};
2021
}
22+
} else if (key.startsWith('cur')) {
23+
const accKey = key.replace('cur', 'acct');
24+
if (tokens[accKey]) {
25+
clientAccounts[tokens[accKey]].currency = value;
26+
}
2127
}
2228
}
2329

@@ -27,8 +33,6 @@ const CallbackPage = () => {
2733
localStorage.setItem('authToken', tokens.token1);
2834
localStorage.setItem('active_loginid', tokens.acct1);
2935

30-
localStorage.setItem('tokens object', JSON.stringify(tokens));
31-
3236
window.location.assign('/');
3337
}}
3438
renderReturnButton={() => {

0 commit comments

Comments
 (0)