Throw error if scopes are requested and client has none
This commit is contained in:
parent
fadcee3f14
commit
094b81f70d
1 changed files with 2 additions and 2 deletions
|
|
@ -120,9 +120,9 @@ export function authorizationHandler({ provider, rateLimit: rateLimitConfig }: A
|
|||
|
||||
// Validate scopes
|
||||
let requestedScopes: string[] = [];
|
||||
if (scope !== undefined && client.scope !== undefined) {
|
||||
if (scope !== undefined) {
|
||||
requestedScopes = scope.split(" ");
|
||||
const allowedScopes = new Set(client.scope.split(" "));
|
||||
const allowedScopes = new Set(client.scope?.split(" "));
|
||||
|
||||
// Check each requested scope against allowed scopes
|
||||
for (const scope of requestedScopes) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue