auth0.isAuthenticated() and auth0.getUser() return false and undefined

I’m trying to save a user session token after executing an Auth0 post-logon action and I am using customClaims to do so. The code essentially boils down to:
exports.onExecutePostLogin = async (event, api) => {
token = getTokenFromBackend()
token = token[“data”][“token”]
api.accessToken.setCustomClaim(${namespace}/session_token, token);
};

Token retrieval is fine, but now I have an issue with retrieving the token. I am using the Auth0-spa sdk for this. I am running this on a localhost.
const auth0Client = new Auth0Client({
domain:
client_id: <client_id>
redirect_uri: “http://localhost:3000/
});
Then I run:
const user = await auth0.getUser();

I don’t know why user is undefiend and auth0.isAuthenticated() is false. Would appreciate some help

Also, is my use of customClaims correct or is there a better way of doing things?

Hallo, I tried this:
const auth0Client = new Auth0Client({
domain:
client_id: <client_id>
redirect_uri: {window.location.origin}
});
I think it is because window.location.origin returns the protocol, hostname, and port of the URL where application is currently running. Issue is in the localhost.
Let me know if works for you?

Sorry, I don’t think this works. I’m still getting an error