Skip to content

Commit 094b81f

Browse files
committed
Throw error if scopes are requested and client has none
1 parent fadcee3 commit 094b81f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/server/auth/handlers/authorize.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ export function authorizationHandler({ provider, rateLimit: rateLimitConfig }: A
120120

121121
// Validate scopes
122122
let requestedScopes: string[] = [];
123-
if (scope !== undefined && client.scope !== undefined) {
123+
if (scope !== undefined) {
124124
requestedScopes = scope.split(" ");
125-
const allowedScopes = new Set(client.scope.split(" "));
125+
const allowedScopes = new Set(client.scope?.split(" "));
126126

127127
// Check each requested scope against allowed scopes
128128
for (const scope of requestedScopes) {

0 commit comments

Comments
 (0)