Skip to content

Commit e01a5e4

Browse files
authored
Merge pull request #265 from dhensby/pulls/types
fix: update typing for validateScope making scope an optional parameter
2 parents 9515530 + 6f185f3 commit e01a5e4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ declare namespace OAuth2Server {
148148
* Validate requested scope. Calls Model#validateScope() if implemented.
149149
*
150150
*/
151-
validateScope(user: User, client: Client, scope: string[]): Promise<string[] | Falsey>;
151+
validateScope(user: User, client: Client, scope?: string[]): Promise<string[] | Falsey>;
152152

153153
/**
154154
* Retrieve info from the request and client and return token
@@ -314,7 +314,7 @@ declare namespace OAuth2Server {
314314
* Invoked to check if the requested scope is valid for a particular client/user combination.
315315
*
316316
*/
317-
validateScope?(user: User, client: Client, scope: string[]): Promise<string[] | Falsey>;
317+
validateScope?(user: User, client: Client, scope?: string[]): Promise<string[] | Falsey>;
318318

319319
/**
320320
* Invoked to check if the provided `redirectUri` is valid for a particular `client`.
@@ -340,7 +340,7 @@ declare namespace OAuth2Server {
340340
* Invoked to check if the requested scope is valid for a particular client/user combination.
341341
*
342342
*/
343-
validateScope?(user: User, client: Client, scope: string[]): Promise<string[] | Falsey>;
343+
validateScope?(user: User, client: Client, scope?: string[]): Promise<string[] | Falsey>;
344344
}
345345

346346
interface RefreshTokenModel extends BaseModel, RequestAuthenticationModel {
@@ -374,7 +374,7 @@ declare namespace OAuth2Server {
374374
* Invoked to check if the requested scope is valid for a particular client/user combination.
375375
*
376376
*/
377-
validateScope?(user: User, client: Client, scope: string[]): Promise<string[] | Falsey>;
377+
validateScope?(user: User, client: Client, scope?: string[]): Promise<string[] | Falsey>;
378378
}
379379

380380
interface ExtensionModel extends BaseModel, RequestAuthenticationModel {}

0 commit comments

Comments
 (0)