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

Inconsistent plugin load order #19

Closed
jlines opened this issue Apr 29, 2015 · 3 comments
Closed

Inconsistent plugin load order #19

jlines opened this issue Apr 29, 2015 · 3 comments
Labels
support Questions, discussions, and general support

Comments

@jlines
Copy link

jlines commented Apr 29, 2015

I am loading my manifest using glue. The plugins section of manifest looks like this

plugins: {
'hapi-auth-jwt':{},
'./server/api/index': {}
}

My api/index calls
server.auth.strategy('token', 'jwt' ....

This call fails sometimes with the message
Authentication strategy token uses unknown scheme: jwt

It seems that the load order of the plugins are not guaranteed which is causing my problem. Is there a recommended way to address this problem?

@Marsup
Copy link
Contributor

Marsup commented Apr 30, 2015

JSON keys order have never been deterministic, use dependencies for that.

@csrl
Copy link
Contributor

csrl commented May 26, 2015

If the manifest's 'plugins' field learned to expect an array, plugin load order could be made deterministic. However, if you are writing a plugin with a known dependency, then using the Server.after() and Server.dependency() support is certainly the proper approach, such that users of your plugin do not need to concern themselves with load order.

@Marsup Marsup added support Questions, discussions, and general support and removed question labels Sep 21, 2019
@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
support Questions, discussions, and general support
Projects
None yet
Development

No branches or pull requests

3 participants