Closed jlines closed 9 years ago
JSON keys order have never been deterministic, use dependencies for that.
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.
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.
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?