I have this react code
const subdomain = boxConfig.domain.includes('stage') ? '.stage' : '';
return (
<Auth0Provider
domain={import.meta.env.VITE_AUTH0_DOMAIN}
clientId={import.meta.env.VITE_AUTH0_LOGIN_CLIENT_ID}
useRefreshTokens
useCookiesForTransactions
cacheLocation="localstorage"
cookieDomain={`${subdomain}.myapp.com`}
onRedirectCallback={onRedirectCallback}
authorizationParams={{
audience: `https://${import.meta.env.VITE_AUTH0_DOMAIN}/api/v2/`,
redirect_uri: window.location.origin,
scope: 'openid profile offline_access email read:current_user',
useRefreshTokens: true,
}}
>
<AuthHook>{children}</AuthHook>
</Auth0Provider>
);
This same component is used in two separate apps, one on myapp.com
and one in dashboard.myapp.com
When I login in myapp.com
, I am currently logged in. However, if I then visit dashboard.myapp.com
, I am not logged in - it requires me to log in.
Also, if I log out from one domain, the other domain still remains logged in.
I have already added both domains to Allowed Callback URLs
and every other URL setting in Auth0.
Help is appreicated