Skip to content

Commit 17d9230

Browse files
authored
Merge pull request #444 from dhensby/fix/types-savetoken-oautherror
fix(types): OAuthError.inner, saveToken input, and getClient clientSecret
2 parents 7c58d87 + 293e52a commit 17d9230

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

index.d.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,13 +258,13 @@ declare namespace OAuth2Server {
258258
* Invoked to retrieve a client using a client id or a client id/client secret combination, depending on the grant type.
259259
*
260260
*/
261-
getClient(clientId: string, clientSecret: string): Promise<Client | Falsey>;
261+
getClient(clientId: string, clientSecret?: string): Promise<Client | Falsey>;
262262

263263
/**
264264
* Invoked to save an access token and optionally a refresh token, depending on the grant type.
265265
*
266266
*/
267-
saveToken(token: Token, client: Client, user: User): Promise<Token | Falsey>;
267+
saveToken(token: Omit<Token, 'client' | 'user'>, client: Client, user: User): Promise<Token | Falsey>;
268268
}
269269

270270
interface RequestAuthenticationModel {
@@ -464,6 +464,11 @@ declare namespace OAuth2Server {
464464
* A human-readable error message.
465465
*/
466466
message: string;
467+
468+
/**
469+
* The original error, present when this error was constructed by wrapping another `Error`.
470+
*/
471+
inner?: Error;
467472
}
468473

469474
class AccessDeniedError extends OAuthError {}

0 commit comments

Comments
 (0)