Ensure we hand out max user.scope

The token.scope was valid at token creation time. The user's scope
could since have changed (maybe we got kicked out of a group).
This commit is contained in:
Girish Ramakrishnan
2018-04-30 22:06:51 -07:00
parent 200f43a58e
commit 240ee5f563
8 changed files with 159 additions and 29 deletions

View File

@@ -44,10 +44,6 @@ function getConfig(req, res, next) {
cloudron.getConfig(function (error, cloudronConfig) {
if (error) return next(new HttpError(500, error));
if (!req.user.admin) {
cloudronConfig = _.pick(cloudronConfig, 'apiServerOrigin', 'webServerOrigin', 'fqdn', 'adminFqdn', 'version', 'progress', 'isDemo', 'cloudronName', 'provider');
}
next(new HttpSuccess(200, cloudronConfig));
});
}