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

Deprecate verifyToken and populateUser hooks in favour of middleware #227

Closed
ekryski opened this Issue Jun 30, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@ekryski
Copy link
Member

ekryski commented Jun 30, 2016

Adding the existing hooks every time is tedious and redundant. Typically you want to verify the token and populate the user on every request anyway.

The middleware will be set up automatically for you and if a token isn't passed in it will just call next(). It is still up to the developer to add a hook to requireUser (or something) for each service method that should require authentication.

I'm thinking we expose the middleware like so:

import { validateToken, populateUser } from 'feathers-auth/middleware';

so that people can monkey with them or use them standalone outside of feathers-auth. We might want ability to pass a config option to not load the user or have people set up this middleware explicitly in case you don't want to lookup the user every time a request is made.

@ekryski ekryski added this to the 1.0 milestone Jun 30, 2016

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Jul 6, 2016

@ekryski

This comment has been minimized.

Copy link
Member Author

ekryski commented Jul 19, 2016

This is coming down the pipe and is implemented in the passwordless branch.

@ekryski

This comment has been minimized.

Copy link
Member Author

ekryski commented Dec 30, 2016

This has been completely revamped and these hooks no longer are used/required. Please see the migration guide for how to upgrade from auth <0.8.0 to v1.x.

@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.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.