From 68d01ad67ea71e20baeb3d505d1ec928448a13af Mon Sep 17 00:00:00 2001 From: Shrihari Prakash Date: Fri, 4 Aug 2023 12:26:00 +0530 Subject: [PATCH 1/2] Marked verifyScope function as optional in model types. --- index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 777bda8..cf6f51b 100644 --- a/index.d.ts +++ b/index.d.ts @@ -279,7 +279,7 @@ declare namespace OAuth2Server { * Invoked during request authentication to check if the provided access token was authorized the requested scopes. * */ - verifyScope(token: Token, scope: string | string[], callback?: Callback): Promise; + verifyScope?(token: Token, scope: string | string[], callback?: Callback): Promise; } interface AuthorizationCodeModel extends BaseModel, RequestAuthenticationModel { From 6c4f73ac46a13229a4918772d79335f1673b125c Mon Sep 17 00:00:00 2001 From: Shrihari Prakash Date: Fri, 4 Aug 2023 12:53:20 +0530 Subject: [PATCH 2/2] Fix PR comments. --- index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/index.d.ts b/index.d.ts index cf6f51b..7fb609e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -277,6 +277,7 @@ declare namespace OAuth2Server { /** * Invoked during request authentication to check if the provided access token was authorized the requested scopes. + * Optional, if a custom authenticateHandler is used or if there is no scope part of the request. * */ verifyScope?(token: Token, scope: string | string[], callback?: Callback): Promise;