diff --git a/src/hooks/custom-hooks/useOAuth.ts b/src/hooks/custom-hooks/useOAuth.ts index 08f4fe1e..fc5040c7 100644 --- a/src/hooks/custom-hooks/useOAuth.ts +++ b/src/hooks/custom-hooks/useOAuth.ts @@ -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; }