Before answering the question, may I provide a bit more context? Here’s the code snippet from our FE which uses auth0-js
package:
...
import { WebAuth } from "auth0-js";
...
export const AuthProvider = (props: AuthProviderProps) => {
const [auth0] = useState<WebAuth>(new WebAuth({
domain: domain,
clientID: clientId,
responseType: responseType,
redirectUri: redirectUri,
audience: audience,
scope: "openid profile email offline_access",,
})
));
....
const renewSession: RenewSession = async () => {
const { err, res } = await new Promise(resolve => auth0.checkSession({}, (err, res: AuthResult) => resolve({ err, res })));
}
...
};
}
...
So to answer your question, inside res
from const { err, res } = await new Promise(resolve => auth0.checkSession({}, (err, res: AuthResult) => resolve({ err, res })));
, the properties look like this:
{
"accessToken": "...",
"idToken": "...",
"idTokenPayload": {
"https://cos.goldn.com/": {
"userId": "..."
},
"nickname": "...",
"name": "...",
"picture": "...",
"updated_at": "2022-07-16T17:52:29.948Z",
"email": "...",
"email_verified": true,
"iss": "...",
"sub": "...",
"aud": "...",
"iat": 1657994279,
"exp": 1658030279,
"at_hash": "...",
"nonce": "..."
},
"appState": "...",
"refreshToken": null,
"state": "...",
"expiresIn": 86400,
"tokenType": "Bearer",
"scope": "openid profile email offline_access"
}
And even though I followed the instruction and set the scope to include offline_access
and enable them in my API, the value of refreshToken
is still null