const auth0 = new Auth0Client({
domain: 'yourdomain.auth0.com',
client_id: 'your_client_id',
redirect_uri: 'http://localhost:3000',
audience: 'https://yourdomain.auth0.com/api/v2/',
useRefreshTokens: true,
cacheLocation: 'localstorage',
scope: 'openid profile email read:current_user update:current_user_metadata',
advancedOptions: {
defaultScope: 'openid profile email read:current_user update:current_user_metadata'
},
issuer: 'https://yourdomain.auth0.com/'
});
auth0.getTokenSilently().then((token) => {
// use the token to make API calls
}).catch((err) => {
console.log(err);
});
如果问题持续存在,请联系Auth0支持团队。