(auth-backend) Bugfix: Do not throw Exception if scopes dont exist. Refs #1786

Currently, the OAuthProvider library in `auth-backend` throws an
Exception if scopes are missing in the `start` (initial) request
in the Authorization flow. Scopes are an optional parameter as per the
spec, so if scopes are empty, simply forward the empty scopes instead of
throwing an Exception
This commit is contained in:
Govindarajan Nagarajan
2020-07-30 15:16:54 +02:00
parent 86672eb8cc
commit 448767712b
@@ -104,10 +104,6 @@ export class OAuthProvider implements AuthProviderRouteHandlers {
// retrieve scopes from request
const scope = req.query.scope?.toString() ?? '';
if (!scope) {
throw new InputError('missing scope parameter');
}
if (this.options.persistScopes) {
this.setScopesCookie(res, scope);
}