Google+ Sign-In with JavaScript callback issue

前端 未结 6 2826
轮回少年
轮回少年 2021-02-08 13:01

I am working on a function which allows users to sign in on my website with their Google account.

My code is based on the Google documentation (others signIn() options a

6条回答
  •  忘掉有多难
    2021-02-08 13:35

    I'm facing this same issue here, but I'm calling gapi.auth.signIn() via a button click handler. The callback is still called twice. One thing I noticed between the two authResult objects was that authResult.status.method is 'AUTO' in the first call (before the popup window appears) and is 'PROMPT' in the second call after the window is auto-dismissed due to previous authorisation.

    The solution I'm exploring now is to ignore the AUTO instance and only process the PROMPT instance of the callback. Not sure how this will work once I revoke the permissions within Google due to the lack of details in the docs on the 'status' object.

提交回复
热议问题