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

feathers-authentication errors with any view error, and redirects to /auth/failure #381

Closed
krisdahl opened this Issue Dec 21, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@krisdahl
Copy link

krisdahl commented Dec 21, 2016

Steps to reproduce

First off, my apologies if this is just my ignorance of the feather ecosystem and architecture. Oer perhaps is a configuration option. Seems odd though, not sure how to resolve.

Add feathers-authentication service to your app.

Set a view engine.
app.set('view engine', 'handlebars');

Cause any sort of error in your view logic. In the case of jade, reference an object that doesn't exist. Or pick a view engine that you don't have installed, which is what I did for this example.

Expected behavior

A normal/general feathers 500 error, or stack trace with error relating to the view engine. Here is example with a missing view engine (handlebars)

From log:

feathers-errors GeneralError(500): Cannot find module 'handlebars'

or stacktrace:

   at Function.Module._resolveFilename (module.js:338:15)
   at Function.Module._load (module.js:289:25)
   at Module.require (module.js:366:17)
   at require (module.js:385:17)
   at new View (/web/feathers-demos/examples/rendering/rendering-templates/node_modules/express/lib/view.js:78:30)
   at EventEmitter.render (/web/feathers-demos/examples/rendering/rendering-templates/node_modules/express/lib/application.js:569:12)
   at ServerResponse.render (/web/feathers-demos/examples/rendering/rendering-templates/node_modules/express/lib/response.js:960:7)
   at Object.feathers.configure.configure.configure.use.use.use.use.use.errorHandler.html [as text/html] (/web/feathers-demos/examples/rendering/rendering-templates/app.js:23:11)
   at /web/feathers-demos/examples/rendering/rendering-templates/node_modules/feathers-errors/lib/error-handler.js:83:36
   at Layer.handle_error (/web/feathers-demos/examples/rendering/rendering-templates/node_modules/express/lib/router/layer.js:71:5)

Actual behavior

feathers-authentication for thinks this is an authentication error, and redirects to /auth/failure. From debug log:

feathers-authentication:middleware An authentication error occurred. { [Error: Cannot find module 'handlebars'] code: 'MODULE_NOT_FOUND' }

System configuration

"feathers": "^2.0.2",
"feathers-authentication": "^0.7.11",
@daffl

This comment has been minimized.

Copy link
Member

daffl commented Dec 21, 2016

Try upgrading to 1.0.0 to see if the issue persists.

@krisdahl

This comment has been minimized.

Copy link
Author

krisdahl commented Dec 22, 2016

I 'upgraded' trying to use migration guide, but have some more work to do to get authentication working again (not super familiar yet with Feathers).
Indeed upgrading to 1.0.0 did work in fixing the error handling problem. Sorry I should have realized.

I was using the generated boilerplate. Any ideas when the "feathers generate" will use feathers-authentication 1.0.0?

@ekryski

This comment has been minimized.

Copy link
Member

ekryski commented Dec 30, 2016

@krisdahl It will. We're currently working on it. Trying hard to get it wrapped before the new year. Glad you got it sorted. 😄

@ekryski ekryski closed this Dec 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.