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
Check: https://developers.google.com/identity/sign-in/web/reference#gapiauth2getauthinstance
and in particular this part:
gapi.auth2.getAuthInstance()
Returns the GoogleAuth object. You must initialize the GoogleAuth object with
gapi.auth2.init()
before calling this method.
For me, the problem is that I didn't call gapi.auth2.init() first