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

Allow the authenticate hook to be called with no parameters #473

hubgit opened this Issue Apr 4, 2017 · 1 comment


None yet
2 participants
Copy link

hubgit commented Apr 4, 2017

After I've configured an app to use local and jwt strategies, I'd like to be able to call auth.hooks.authenticate() as a before hook, with no parameters, and have it use the registered strategies by default.

That would make use of the hook more straightforward, unless there's a reason not to allow the local strategy in places where you would otherwise call auth.hooks.authenticate(['jwt'])?


This comment has been minimized.

Copy link

ekryski commented Apr 11, 2017

Nope sorry. We want to keep the strategies you specify explicit. For 3 reasons:

  1. So that it is clear which auth which strategies protect which services or plain old express middleware; and
  2. because you could have different combinations of auth strategies based for different services; and
  3. You can override your default options you configured the strategy with when you register the authenticate hook or middleware.

Thanks for the suggestion though! 😄

@ekryski ekryski closed this Apr 11, 2017

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.