apps: hasAccessTo -> canAccess
This commit is contained in:
@@ -167,7 +167,7 @@ async function authorize(req, res, next) {
|
||||
const [error, app] = await safe(apps.get(appId));
|
||||
if (error) return next(new HttpError(403, 'No such app' ));
|
||||
|
||||
if (!apps.hasAccessTo(app, req.user)) return next(new HttpError(403, 'Forbidden' ));
|
||||
if (!apps.canAccess(app, req.user)) return next(new HttpError(403, 'Forbidden' ));
|
||||
|
||||
const token = jwt.sign({ user: users.removePrivateFields(req.user) }, TOKEN_SECRET, { expiresIn: `${constants.DEFAULT_TOKEN_EXPIRATION_DAYS}d` });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user