devbaji/vue3-google-login

Using slot to have a custom button changes the flow

Frement opened this issue · 1 comments

Customizing the button with any content changes the default flow. Callback doesn't get credential returned, instead it gets code, scope, authuser, hd and prompt.

Also it is requesting extra scopes email and profile.

This only happens when using the components slot.

You must handle this differently according to docs: https://yobaji.github.io/vue3-google-login/#custom-login-button

❗ For custom buttons this plugin use google.accounts.oauth2.initCodeClient and google.accounts.oauth2.initTokenClient under the hoods which gives OAuth2 authorization code and Access Token respectively in the callback response, but Google rendered login button and One Tap prompt gives a CredentialResponse with a JWT credential field, so if you are using a combination of these, validating your callback response on server-side can be a little tricky, this is more explained here