Return canonical scope in REST responses

The '*' scope is purely an implementation detail. It cannot
be requested as such.
This commit is contained in:
Girish Ramakrishnan
2018-05-02 12:36:35 -07:00
parent 182ea3dac3
commit f09e8664d1
4 changed files with 11 additions and 11 deletions
-3
View File
@@ -28,9 +28,6 @@ function add(req, res, next) {
if (typeof data.scope !== 'string' || !data.scope) return next(new HttpError(400, 'scope is required'));
if (!validUrl.isWebUri(data.redirectURI)) return next(new HttpError(400, 'redirectURI must be a valid uri'));
// allow whitespace
data.scope = data.scope.split(',').map(function (s) { return s.trim(); }).join(',');
clients.add(data.appId, clients.TYPE_EXTERNAL, data.redirectURI, data.scope, function (error, result) {
if (error && error.reason === ClientsError.INVALID_SCOPE) return next(new HttpError(400, error.message));
if (error && error.reason === ClientsError.BAD_FIELD) return next(new HttpError(400, error.message));