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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 15, 2020. It is now read-only.
For every request made by a logged in user getUserForContext fetch the entire user doc.
Normally only the userId (+ a role flied) is relevant for access controlling.
It would be more performant if getUserForContext fetch the minimum required fields for this package to work properly as well as allowing the developer to configure additional fields to fetch wich are required by the app.
/label feature
The text was updated successfully, but these errors were encountered:
Hi @lorensr since Meteor "recently" supports $expr by Mongo 3.6 and now 4.0, I'm using this query to delegate token checking to mongo and fetch only the minimum required user fields.
Oh cool! Didn't know you could do that with Mongo. Not sure if the speed improvement is worth the added complexity—perhaps the rare cases in which the JS logic is a speed problem can find this issue and use your code.
Note it's not only js processing, you save the network bandwidth required to retrieve the user object, for all the request that require token verification. Depending on the application, that requests could be the majority.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
featureFeature: new addition or enhancement to existing solutionshelp wanted
For every request made by a logged in user
getUserForContext
fetch the entire user doc.Normally only the userId (+ a role flied) is relevant for access controlling.
It would be more performant if
getUserForContext
fetch the minimum required fields for this package to work properly as well as allowing the developer to configure additional fields to fetch wich are required by the app./label feature
The text was updated successfully, but these errors were encountered: