Skip to content

Commit

Permalink
Merge pull request #81 from deriv-com/revert-80-thisyahlen/rename-loc…
Browse files Browse the repository at this point in the history
…alstorage-key

Revert "chore: fix localstorage key name"
  • Loading branch information
shayan-deriv authored Sep 30, 2024
2 parents 6d7f1b5 + 6993d42 commit c042a07
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/context/auth-context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const AuthDataProvider = ({ children }: AuthDataProviderProps) => {
accountsList[account.loginid] = account.token;
});

localStorage.setItem('client.accounts', JSON.stringify(accountsList));
localStorage.setItem('accountsList', JSON.stringify(accountsList));

URLUtils.filterSearchParams(paramsToDelete);

Expand All @@ -94,15 +94,15 @@ export const AuthDataProvider = ({ children }: AuthDataProviderProps) => {
const appendAccountLocalStorage = useCallback((loginid: string, token: string) => {
accountsList[loginid] = token;

localStorage.setItem('client.accounts', JSON.stringify(accountsList));
localStorage.setItem('accountsList', JSON.stringify(accountsList));

switchAccount(loginid);
}, []);

const logout = useCallback(async () => {
await requestLogout({});
localStorage.removeItem('authToken');
localStorage.removeItem('client.accounts');
localStorage.removeItem('accountsList');

setActiveLoginid('');
}, []);
Expand Down

0 comments on commit c042a07

Please sign in to comment.