We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d5ae484 commit 0d98453Copy full SHA for 0d98453
lib/utils/scope-util.js
@@ -3,14 +3,16 @@ const InvalidScopeError = require('../errors/invalid-scope-error');
3
4
module.exports = {
5
parseScope: function (requestedScope) {
6
- if (!isFormat.nqschar(requestedScope)) {
+ // XXX: isFormat.nqschar will trat Arrays of strings like String,
7
+ // thus we additionally check, whether incoming scopes are Arrays
8
+ if (!isFormat.nqschar(requestedScope) || Array.isArray(requestedScope)) {
9
throw new InvalidScopeError('Invalid parameter: `scope`');
10
}
11
12
if (requestedScope == null) {
13
return undefined;
14
15
- return Array.isArray(requestedScope) ? requestedScope : requestedScope.split(' ');
16
+ return requestedScope.split(' ');
17
18
};
0 commit comments