Skip to content

Commit

Permalink
Merge pull request #186 from energywebfoundation/bug/SWTCH-998-add-to…
Browse files Browse the repository at this point in the history
…-did-doc

fix(iam): parse claimData from requested token
  • Loading branch information
jrhender committed Jun 9, 2021
2 parents 91188f2 + 5665ba1 commit 48c25ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/iam.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1483,9 +1483,9 @@ export class IAM extends IAMBase {
if (!this._jwt) {
throw new Error(ERROR_MESSAGES.JWT_NOT_INITIALIZED);
}
const { claimType, claimTypeVersion, sub } = this._jwt.decode(token) as { claimType: string; claimTypeVersion: string; sub: string };
const { claimData, sub } = this._jwt.decode(token) as { claimData: { claimType: string; claimTypeVersion: string }; sub: string };
const issuedToken = await this.issuePublicClaim({
token: await this._jwt.sign({ claimType, claimTypeVersion }, { subject: sub, issuer: this._did })
token: await this._jwt.sign({ claimData }, { subject: sub, issuer: this._did })
});
const message: IClaimIssuance = {
id,
Expand Down

0 comments on commit 48c25ea

Please sign in to comment.