GoogleWebComponents / google-signin

Google Sign-in web component
https://elements.polymer-project.org/elements/google-signin
Other
279 stars 89 forks source link

"on-google-signin-aware-" events don't fire when opened in background. #152

Open danjacques opened 7 years ago

danjacques commented 7 years ago

The code that ultimately results in the events being fired iterates through the signinAwares list, which is the list of <google-auth-signin-aware> elements that have been attached at that point.

I encountered an issue with this element when opening a page in the background (e.g., middle-click on a link). At this point, Polymer sets enough properties to kick off the AuthEngine initialization and login workflow, but Polymer hasn't actually attached all of its elements yet, so elements that are bound via Polymer to that event don't actually receive it.

I was able to fix this by hooking Polymer's ready event instead of its attached event here.