Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

BearerStrategy initialization is asynchronous #167

Closed
kayjtea opened this issue Aug 11, 2016 · 4 comments
Closed

BearerStrategy initialization is asynchronous #167

kayjtea opened this issue Aug 11, 2016 · 4 comments

Comments

@kayjtea
Copy link

kayjtea commented Aug 11, 2016

When initializing metadata from URL, initialization is asynchronous. This leads to the server listening for HTTP requests before passport is fully ready to be used. In a situation where instances are spun up as needed, this leads to some web requests failing. Initialization should probably take a done callback as well as an error callback. Or maybe initialization should be synchronous. Have any of you run into this problem?

@kayjtea
Copy link
Author

kayjtea commented Aug 11, 2016

Oops I see the callback is passed err === null on success.

@kayjtea kayjtea closed this as completed Aug 11, 2016
@kayjtea
Copy link
Author

kayjtea commented Aug 11, 2016

But callback isn't exposed by Strategy initialization.

@kayjtea kayjtea reopened this Aug 11, 2016
@lovemaths
Copy link
Contributor

@kayjtea This is issue #90 , we already fixed this problem in dev branch and we will put the fix into the next release. Thanks.

@lovemaths
Copy link
Contributor

Shipped the fix in the most recent release (v2.0.1), closing the issue.

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

No branches or pull requests

2 participants