Skip to content

Commit

Permalink
null-check on verifiedIdToken?
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderPostma committed Feb 28, 2024
1 parent 5d8648a commit 1a699a3
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 ?? verifiedIdToken?.payload.nonce ?? oid4vp.nonce;
const state = merged.state ?? verifiedIdToken?.payload.state;

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

0 comments on commit 1a699a3

Please sign in to comment.