Closed mihaixyx closed 5 years ago
Ran into this issue myself yesterday. Added a PR here in case it's of use.
Thanks @mihaixyx and @peturv. We just got back from Dev days in Seattle so we'll work on getting this approved as soon as possible.
Fixed via #183, thanks @mihaixyx for reporting and @peturv for fixing !! We'll cut a new release once we got all these PR's merged in.
Do you want to request a feature, report a bug, or improve documentation? A bug.
So I was trying to implement passportjs into a project based on this server, and I noticed that any middleware does not work.
The bug can be found while passing the config to the function authenticationMiddleware inside of src/server/router.js at the enableResourceRoutes function. Calling the function as "authenticationMiddleware( {config} )" creates a object that would look something like "config { config { } }", while the calls inside of the authenticationMiddleware() inside of the src/server/middleware/authentication.middleware.js treat the object just as a "config { }".
The problem can be solved by either calling authenticationMiddleware( config ) ( instead of authenticationMiddleware( {config} ) ) inside of the enableResourceRoutes, or by using "config.config.auth && config.config.auth.strategy" inside of the authentication.middleware file.