We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4af709 commit 46be3f5Copy full SHA for 46be3f5
lib/middleware/user-context.js
@@ -25,14 +25,9 @@ module.exports = function userContextMiddleware() {
25
const UserModel = app.accessUtils.options.userModel || 'User';
26
const GroupAccessModel = app.accessUtils.options.groupAccessModel || 'GroupAccess';
27
28
-
29
return Promise.join(
30
app.models[UserModel].findById(req.accessToken.userId),
31
- app.models[GroupAccessModel].find({
32
- where: {
33
- userId: req.accessToken.userId
34
- }
35
- }),
+ app.accessUtils.getUserGroups(req.accessToken.userId),
36
(user, groups) => {
37
if (!user) {
38
return next(new Error('No user with this access token was found.'));
0 commit comments