How To Sign Out Using When Using Google+ Sign-In

前端 未结 1 2048
日久生厌
日久生厌 2020-12-31 22:27

Google documents there gapi.auth.signOut() method here: https://developers.google.com/+/web/signin/#sign-out

The catch is that it says you can only call

相关标签:
1条回答
  • 2020-12-31 23:21

    The button just has to be in the DOM, it doesn't have to be showing. What seems to work well is:

    1. Create a hidden element and attach the gapi handler with gapi.signin.render
    2. Wait for the immediate_failed error - display the button then
    3. Otherwise, accept the signed in callback, and display the logout button

    Then you'll get a callback every time, but only show the button when signed out.

    0 讨论(0)
提交回复
热议问题