Closed hexsprite closed 9 years ago
seems to be some kind of timing issue. if I manually execute the code in the console it brings up the login dialog.
I'm taking a look now. :-)
I should probably wait until the subscription for login configuration is .ready. Outside of testing this library it's probably not an issue because login will generally be hooked up to a button or something.
Ah ok. I think I know. In order to login via oauth, you need the API keys of the oauth service that the server sends you. Those are sent automatically when you connect, when asteroid subscribes to the meteor.loginServiceConfiguration
collection (see here). Until the subscription is ready, the collection won't be populated, hence the error.
Exactly. :-D
Yes, also because most browsers won't let you open popups unless on response to user events (e.g. clicks). But even for testing, the subscribe
method is memoized, so if you call ddp.subscribe("meteor.loginServiceConfiguration")
again, it'll return you the same subscription object it returned the first time.
Using Chrome.
I get this error:
From this method: