Skip to content
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

Add init event #137

Open
nodirt opened this issue Mar 24, 2016 · 0 comments
Open

Add init event #137

nodirt opened this issue Mar 24, 2016 · 0 comments

Comments

@nodirt
Copy link
Contributor

nodirt commented Mar 24, 2016

There is no event in google-signin/google-singin-aware that is fired when gapi.auth2 is initialized. It makes really hard to use these elements in a static SPA.

I'd like to send iron-ajax requests to load actual page contents either (a) anonymously when the user is not signed in or (b) authenticated if the user is signed in. However, there is no way to tell whether google-signin* element is signing in in the background and I eventually will get an access token, or it is doing nothing because there is no cookie.

I tried to work around by forcing signin by calling signIn() in my ready() function, but it fails with an error because auth instance is not initialized at that time, and I don't know when to call it because there is no init event!

I cannot even work with gapi.auth2 directly, bypassing google-signin, because google-singin* takes full ownership of gapi.auth2 instance and initializes it itself when I set client-id.

Am I doing something wrong? Sending an authenticated request to load page contents seems to be a common usage scenario.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants