var Token;
componentDidMount() {
auth0.webAuth.authorize({
scope: 'openid profile email',
audience: 'https://MyDomain/userinfo'
})
.then(credentials =>
console.log(credentials.accessToken))
this.key=credentials.accessToken;
}
Try this
var Token;
componentDidMount() {
auth0.webAuth.authorize({
scope: 'openid profile email',
audience: 'https://MyDomain/userinfo'
})
.then(credentials => {
console.log(credentials.accessToken);
this.key=credentials.accessToken });
}