My application has 2 major routes (auth route and unauth route).
When an user lands from auth to unauth route, I need to test whether the user is authenticated in order to handle some specific cases.
I’m using @auth0/auth0-spa-js
and using these params to create an auth0 instance:
import { createAuth0Client } from ‘@auth0/auth0-spa-js’;
const auth0Client = yield createAuth0Client({
domain: ‘domain’,
clientId: ‘clientId’,
cacheLocation: ‘memory’,
authorizationParams: { audience: ‘audience’, redirect_uri: ‘redirect_uri’ }
});
PS: Using cacheLocation: ‘localStorage’ works fine, however I cannot use it for security reasons.
Thank you in advance.