vue-google-login icon indicating copy to clipboard operation
vue-google-login copied to clipboard

Can't read access_token inside onSuccess anymore

Open marcoarruda opened this issue 4 years ago • 1 comments

My app was reading the access_token inside the onSuccess method like below:

onSuccess (login) {
    const accessToken = login.ws.access_token
}

Suddenly, it is not available anymore, but inside another attribute:

onSuccess (login) {
    const accessToken = login.xc.access_token
}

Is there a method that I can use instead so I don't relay on an attribute like this? Any chances that GoogleOAuth2 has been updated?

marcoarruda avatar Nov 19 '20 12:11 marcoarruda

Try

login.getAuthResponse().id_token

or

login.getBasicProfile().getEmail()

To get the profile email address, for example.

daltonrooney avatar Mar 10 '21 04:03 daltonrooney