When a user logs-in via the loginWithRedirect() method of auth0-spa-js, and returns to the callback URL, handleRedirectCallback() is processed successfully, but subsequent calls to getUser() return undefined and isAuthenticated() returns false. The Auth0 Hosted Logs show an error entitled “Failed Silent Auth”:
{
"date": "2019-09-22T18:54:07.091Z",
"type": "fsa",
"description": "Login required",
"client_id": "...",
"client_name": "...",
"ip": "...",
"user_agent": "Safari 13.0.1 / Mac OS X 10.15.0",
"details": {
"body": {},
"qs": {
"client_id": "...",
"scope": "openid profile email",
"response_type": "code",
"response_mode": "web_message",
"state": "...",
"nonce": "...",
"redirect_uri": "...",
"code_challenge": "",
"code_challenge_method": "S256",
"prompt": "none",
"auth0Client": "..."
},
"connection": null,
"error": {
"message": "Login required",
"oauthError": "login_required",
"type": "oauth-authorization"
}
},
"hostname": "...",
"audience": "https://HOSTNAME/userinfo",
"scope": [
"openid",
"profile",
"email"
],
"auth0_client": {
"name": "auth0-spa-js",
"version": "1.2.3"
},
"isMobile": false
}
I followed these instructions for loginWithRedirect(), handleRedirectCallback(), and getUser(): Auth0 Single Page App SDK