diff --git a/src/features/AuthStore/hooks/useAuth.tsx b/src/features/AuthStore/hooks/useAuth.tsx index 50f41613..ce3a0133 100644 --- a/src/features/AuthStore/hooks/useAuth.tsx +++ b/src/features/AuthStore/hooks/useAuth.tsx @@ -87,6 +87,21 @@ export const useAuth = () => { const loadedUser = await userManager.getUser() if (!loadedUser) { + if (window.location.pathname.includes(PAGES.mailings)) { + const url = new URL(window.location.href) + const access_token = url.searchParams.get('access_token') || '' + + writeToken(access_token) + setCookie({ + exdays: 1, + name: 'access_token', + value: access_token, + }) + + access_token && await fetchUserInfo() + return Promise.resolve() + } + if (!readToken()) { const token = await getTemporaryToken() token && await fetchUserInfo()