Skip to content

Commit

Permalink
Merge pull request #265 from dhensby/pulls/types
Browse files Browse the repository at this point in the history
fix: update typing for validateScope making scope an optional parameter
  • Loading branch information
jankapunkt authored Nov 18, 2023
2 parents 9515530 + 6f185f3 commit e01a5e4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ declare namespace OAuth2Server {
* Validate requested scope. Calls Model#validateScope() if implemented.
*
*/
validateScope(user: User, client: Client, scope: string[]): Promise<string[] | Falsey>;
validateScope(user: User, client: Client, scope?: string[]): Promise<string[] | Falsey>;

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

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

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

interface ExtensionModel extends BaseModel, RequestAuthenticationModel {}
Expand Down

0 comments on commit e01a5e4

Please sign in to comment.