Skip to content

Commit

Permalink
Populate active wallet login id from cookies (#17835)
Browse files Browse the repository at this point in the history
* chore: populate active wallet login id from cookies

* chore: remove additional check
  • Loading branch information
shahzaib-deriv authored Dec 17, 2024
1 parent f7ea482 commit 8cf6824
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/core/src/App/Containers/Redirect/redirect.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,19 @@ const Redirect = observer(() => {
// to be logged in coming from OS subdomains
const client_accounts = Cookies.get('client.accounts');
const active_loginid = Cookies.get('active_loginid');
const active_wallet_loginid = Cookies.get('active_wallet_loginid');

if (client_accounts && active_loginid) {
localStorage.setItem('client.accounts', client_accounts);
localStorage.setItem('active_loginid', active_loginid);
localStorage.setItem('active_wallet_loginid', active_wallet_loginid);

const domain = getDomainName();

// remove cookies after populating local storage
Cookies.remove('client.accounts', { domain, secure: true });
Cookies.remove('active_loginid', { domain, secure: true });
Cookies.remove('active_wallet_loginid', { domain, secure: true });

if (url_params.get('action') === 'redirect') {
window.location.href = window.location.origin + url_params.get('redirect_to');
Expand Down

0 comments on commit 8cf6824

Please sign in to comment.