TypeError: gapi.auth2 undefined

后端 未结 1 814
梦谈多话
梦谈多话 2020-12-29 03:02

I went exactly by the instructions for integrating google sign-in:

https://developers.google.com/identity/sign-in/web/sign-in#specify_your_apps_client_id

sig

1条回答
  •  灰色年华
    2020-12-29 03:32

    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
    
      
    
    
    

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