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
+20
View File
@@ -0,0 +1,20 @@
'use strict';
exports = module.exports = {
getCloudronConfig: getCloudronConfig
};
var cloudron = require('../cloudron.js'),
HttpError = require('connect-lastmile').HttpError,
HttpSuccess = require('connect-lastmile').HttpSuccess,
_ = require('underscore');
function getCloudronConfig(req, res, next) {
cloudron.getConfig(function (error, cloudronConfig) {
if (error) return next(new HttpError(500, error));
var result = _.pick(cloudronConfig, 'apiServerOrigin', 'webServerOrigin', 'fqdn', 'adminFqdn', 'version', 'progress', 'isDemo', 'cloudronName', 'provider');
next(new HttpSuccess(200, result));
});
}