Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.

Commit

Permalink
fix: Verified ID token is optional. Was assumed for nonce and state d…
Browse files Browse the repository at this point in the history
…etermenation
  • Loading branch information
nklomp committed Feb 29, 2024
1 parent 5d8648a commit 65f5273
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/authorization-response/AuthorizationResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ export class AuthorizationResponse {
const verifiedIdToken = await this.idToken?.verify(verifyOpts);
const oid4vp = await verifyPresentations(this, verifyOpts);

const nonce = merged.nonce ?? verifiedIdToken.payload.nonce ?? oid4vp.nonce;
const state = merged.state ?? verifiedIdToken.payload.state;
const nonce = merged.nonce ?? oid4vp.nonce ?? verifiedIdToken?.payload.nonce;
const state = merged.state ?? verifiedIdToken?.payload.state;

if (!state) {
throw Error(`State is required`);
Expand Down

0 comments on commit 65f5273

Please sign in to comment.