guruahn / vue-google-oauth2

🔌 Handling Google sign-in and sign-out for Vue.js applications
MIT License
183 stars 55 forks source link

error in parent page "popup_closed_by_user" #34

Closed guruahn closed 4 years ago

guruahn commented 4 years ago

Describe the bug shown error, when the google sign-in popup closed

To Reproduce Steps to reproduce the behavior:

  1. Go to Front-end Demo
  2. test sign-in
  3. google sign-in popup open, and complete google login, and popup close.
  4. See error in parent page error: "popup_closed_by_user" (cb=gapi.loaded_0 (268,25))

Desktop (please complete the following information):

Not always, but sometimes this happens.

Wickeey commented 4 years ago

maybe there are better solutions but this worked for me

methods: {
    async googleSignIn() {
      const googleUser = await this.$gAuth.signIn().catch(() => {
        return null
      })

      if (!googleUser) {
        return null
      }
      .....
    }
}
guruahn commented 4 years ago

@Wickeey Thank you. It seems to be resolved.