loginWith()
function is a promise. You have forgot the await
or the .then()
to handle the response:
async signIn () {
await this.$auth.loginWith('github');
this.$axios.get('https://api.github.com/users/mapbox').then(...)
}
or
signIn () {
this.$auth.loginWith('github').then((data) => {
this.$axios.get('https://api.github.com/users/mapbox').then(...)
}
In addition, you have to catch the errors from loginWith
promise.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…