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

onBeforeLogin Hook #161

Closed
ansarizafar opened this Issue Apr 16, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@ansarizafar
Copy link

ansarizafar commented Apr 16, 2016

In certain situations, it is necessary to perform some checks before allowing a user to login. I propose an onBeforeLogin hook to allow adding custom logic. This feature is very important for my use case but currently I have not found any solution to perform some checks before allowing a user to login.

@gurisko

This comment has been minimized.

Copy link

gurisko commented Apr 16, 2016

Hey @ansarizafar. You can do this already by adding a before hook to the auth service:

const hooks = require('./hooks')
const authTokenService = app.service('/auth/token')
authTokenService.before(hooks.before)
authTokenService.after(hooks.after)

@ekryski ekryski closed this Apr 17, 2016

@ekryski

This comment has been minimized.

Copy link
Member

ekryski commented Apr 17, 2016

Closing because @gurisko already answered this. Thanks @gurisko! 😄

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.