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

Race condition w/ loadAdapter #38

Closed
johansten opened this issue Dec 5, 2013 · 1 comment
Closed

Race condition w/ loadAdapter #38

johansten opened this issue Dec 5, 2013 · 1 comment

Comments

@johansten
Copy link

Somewhat related to issue #2.

var googleAuth = new OAuth2('google', {
    client_id:      client_id,
    client_secret:  client_secret,
    api_scope:      scopes.join(' ')
});

googleAuth.authorize(function() {
    /* ... */
});

Both OAuth2 and authorize load the adapter.

OAuth2 doesn't set the source config until after the adapter is loaded. Sometimes the loadAdapter() callback in authorize is called before the loadAdapter() callback in OAuth2, and when that happens openAuthorizationCodePopup() doesn't have a valid config.

I hacked it by adding a callback to OAuth2, and calling authorize from there, but that's just a hack.

@johansten
Copy link
Author

See #39 for a fix.

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

No branches or pull requests

1 participant