wavezync / vue3-google-signin

Google OAuth2 plugin for Vue3 Apps. This uses latest Google Identity Service Library. It also provides set of composables which can be used easily to implement different authentication strategies
https://vue3-google-signin.wavezync.com/
MIT License
161 stars 18 forks source link

Calling useOneTap with this dependency package is always onError #79

Closed dfangdev closed 3 months ago

dfangdev commented 3 months ago

Describe the bug. nuxt3 versioin 3.8.0 , nuxt-vue3-google-signin version 0.0.11

To Reproduce

  1. useOneTap({ onSuccess: (response: CredentialResponse) => { console.log("Success:", response); }, onError: (e: void) => console.error("Error with One Tap Login",), // options });
  2. Enter the page and Google one-click login pops up. Click to log in and always receive the onError callback. 3.Tip Error with One Tap Login

Screenshots Expect to go to onSuccess.

Smartphone (please complete the following information):

lzdyes commented 3 months ago

I also encountered this problem. When I integrated Google One Tap and tested it in Chrome on macOS, the onError callback was always triggered, but there was no detailed error message. So, I had to debug it myself. I found that the login was actually successful, because when it called back to the callback, there was no clientId field, which caused the plugin to determine that it was not successful.

https://github.com/wavezync/vue3-google-signin/blob/7c15d7d9e60697c0fab2c0c3a23e97443e19039e/src/composables/useOneTap.ts#L222C33-L222C41

image