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

Custom Authentication Hooks #236

Closed
imns opened this Issue Jul 11, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@imns
Copy link

imns commented Jul 11, 2016

Is is possible to create custom authentication hooks? I need to preform some actions after a user is authenticated and a hook seems like the appropriate thing to use.

If so, how would I go about doing it, since the authentication service is not created like other services it has me a little confused.

const authentication = require('feathers-authentication');

module.exports = function() {
    const app = this;
    let config = app.get('auth');

    app.configure(authentication(config));
};

@marshallswain

This comment has been minimized.

Copy link
Member

marshallswain commented Jul 11, 2016

The auth services are available for lookup the same as with other services. So you can do app.service('auth/local').after(...) or app.service('auth/token').after(...) for example.

@marshallswain

This comment has been minimized.

Copy link
Member

marshallswain commented Jul 11, 2016

If you need to modify an OAuth flow, use the users service.

@imns

This comment has been minimized.

Copy link
Author

imns commented Jul 11, 2016

Excellent, thank you!

@imns imns closed this Jul 11, 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.