HTML PHP google single sign on signout will throw “Cannot read property 'getAuthInstance' of undefined”

前端 未结 4 847
既然无缘
既然无缘 2021-02-07 04:46

I have created google single sign on by following steps mentioned in https://developers.google.com/identity/sign-in/web/sign-in

The sign in works like a charm but when

4条回答
  •  别跟我提以往
    2021-02-07 05:16

    Are signIn and signOut used on the same page? Div g-signin2 loads and inits gapi.auth2 so it should work as long as those are on the same page.

    In case signOut is on separate page, you should manually load and init gapi.auth2 library.

    Full example (you have to replace YOUR_CLIENT_ID with your actual client_id):

    
    
       
    
    
      
      Sign out
    
      
    
    
    

提交回复
热议问题