-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gapi: attempts to signIn/signOut lead to "TypeError: cannot read property 'postMessage' of null" #238
Comments
Facing same issue when calling .signOut () and calling gapi.auth2.getAuthInstance().currentUser.get().reloadAuthResponse(); |
@Eljoy @devravi |
@TMSCH Here is the simplest code one can use to verify the described issue. Click "Sign Out" button and check out the console, to see an error "Uncaught TypeError: Cannot read property 'postMessage' of null". https://plnkr.co/edit/oFcRee13CynUC7LtPERv?p=preview Thanks! |
@Eljoy thanks for providing the snippet! The issue is the one I expected and mentioned in my previous comment. The
The issue does not happen anymore as the IFrame is preserved. Would that solve your problem? |
@TMSCH Yes, thanks! The solution turned out to be so simple :) |
You're welcome! Glad you got it to work! |
@TMSCH I have same problem with error " Cannot read property 'postMessage' of null". I create a page login , when I click login button it will authorize and redirect to home page. But when I logout I redirect to sign in page , but I click login button, it doesn't working . I need refresh page and it work well. So i dont use any clients js such as react or angular js. I use ruby on rails as server . Please help me if you can .Thank so much |
gapi.auth2 relies on an IFrame to sign in and sign out users. ref. google/google-api-javascript-client#238 (comment)
I have the same problem with error "Cannot read property 'postMessage' of null" when i try to signin using gapi. |
After using ui-router's $state.reload() to update current state, any attempts to GoogleAuth.signIn/GoogleAuth.signOut lead to
"TypeError: Cannot read property 'postMessage' of null at NU"
The text was updated successfully, but these errors were encountered: