Skip to content

Commit

Permalink
feat: issued claim includes only role info
Browse files Browse the repository at this point in the history
  • Loading branch information
JGiter committed May 13, 2021
1 parent bada14f commit 0d403a0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/iam.ts
Expand Up @@ -1381,7 +1381,13 @@ export class IAM extends IAMBase {
if (!this._did) {
throw new Error(ERROR_MESSAGES.USER_NOT_LOGGED_IN);
}
const issuedToken = await this.issuePublicClaim({ token });
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 issuedToken = await this.issuePublicClaim({
token: await this._jwt.sign({ claimType, claimTypeVersion }, { subject: sub, issuer: this._did })
});
const message: IClaimIssuance = {
id,
issuedToken,
Expand Down

0 comments on commit 0d403a0

Please sign in to comment.