Skip to content

Commit

Permalink
fix(types): validateJwtAuthResponse expectedState is optional
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed May 2, 2022
1 parent 3f1893f commit e618089
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions docs/functions/validateJwtAuthResponse.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Function: validateJwtAuthResponse

**validateJwtAuthResponse**(`as`, `client`, `parameters`, `expectedState`, `options?`): `Promise`<`CallbackParameters` \| [`OAuth2Error`](../interfaces/OAuth2Error.md)\>
**validateJwtAuthResponse**(`as`, `client`, `parameters`, `expectedState?`, `options?`): `Promise`<`CallbackParameters` \| [`OAuth2Error`](../interfaces/OAuth2Error.md)\>

Same as [validateAuthResponse](validateAuthResponse.md) but for signed JARM responses.

**`see`** [openid-financial-api-jarm-ID1 - JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)](https://openid.net/specs/openid-financial-api-jarm-ID1.html)

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `as` | [`AuthorizationServer`](../interfaces/AuthorizationServer.md) | Authorization Server Metadata |
| `client` | [`Client`](../interfaces/Client.md) | Client Metadata |
| `parameters` | `URL` \| `URLSearchParams` | JARM authorization response |
| `expectedState` | `string` \| typeof [`expectNoState`](../variables/expectNoState.md) \| typeof [`skipStateCheck`](../variables/skipStateCheck.md) | Expected "state" parameter value |
| `options?` | [`HttpRequestOptions`](../interfaces/HttpRequestOptions.md) | - |
| Name | Type | Default value | Description |
| :------ | :------ | :------ | :------ |
| `as` | [`AuthorizationServer`](../interfaces/AuthorizationServer.md) | `undefined` | Authorization Server Metadata |
| `client` | [`Client`](../interfaces/Client.md) | `undefined` | Client Metadata |
| `parameters` | `URL` \| `URLSearchParams` | `undefined` | JARM authorization response |
| `expectedState` | `string` \| typeof [`expectNoState`](../variables/expectNoState.md) \| typeof [`skipStateCheck`](../variables/skipStateCheck.md) | `expectNoState` | Expected "state" parameter value |
| `options?` | [`HttpRequestOptions`](../interfaces/HttpRequestOptions.md) | `undefined` | - |

#### Returns

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3150,7 +3150,7 @@ export async function validateJwtAuthResponse(
as: AuthorizationServer,
client: Client,
parameters: URLSearchParams | URL,
expectedState: string | typeof expectNoState | typeof skipStateCheck,
expectedState: string | typeof expectNoState | typeof skipStateCheck = expectNoState,
options?: HttpRequestOptions,
): Promise<CallbackParameters | OAuth2Error> {
assertIssuer(as)
Expand Down

0 comments on commit e618089

Please sign in to comment.