Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update typing for validateScope making scope an optional parameter #265

Merged
merged 2 commits into from
Nov 18, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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