Skip to content

Commit

Permalink
fix: clean up token and store it in localstorage
Browse files Browse the repository at this point in the history
  • Loading branch information
ameerul-deriv committed Dec 23, 2024
1 parent 009fb37 commit 00a5106
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/hooks/custom-hooks/useOAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ const useOAuth = (): UseOAuthReturn => {
const authTokenCookie = Cookies.get('authtoken');

if (from === 'tradershub' && authTokenCookie) {
localStorage.setItem('authToken', authTokenCookie);
const cleanedAuthToken = decodeURIComponent(authTokenCookie).replace(/^"|"$/g, '');
localStorage.setItem('authToken', cleanedAuthToken);
Cookies.remove('authtoken');
window.location.href = window.location.origin;
}
Expand Down

0 comments on commit 00a5106

Please sign in to comment.