Skip to content

Is the authenticate hook needed before authorize? #76

Answered by fratzinger
lukashass asked this question in Q&A
Discussion options

You must be logged in to vote

Moin!

Thanks for starting a discussion about that.

I don't see a problem with using context.params.user. Using authenticate has some advantages. Primarily I use it in one application where this use case perfectly fits into the authenticate mechanism. This is how I use feathers-casl:

  • permissions rarely change per user/session. Only on logout/login.
  • I need the permissions on the client for UX stuff

This results in two important things in our application:

  1. So by using authenticate I only fetch the permissions once for the session; I would have to fetch the permissions on every request. But remember‼️ This only applies to websocket connections. For rest connections, you have to take the con…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lukashass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants