Skip to content

Commit

Permalink
feat(createDelegateProof): using ew-did-registry/jwt
Browse files Browse the repository at this point in the history
  • Loading branch information
knzeng-e committed Oct 6, 2021
1 parent a372742 commit cea0e8d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -77,6 +77,7 @@
"eth-ens-namehash": "^2.0.8",
"ethers": "^5.4.4",
"js-sha3": "^0.8.0",
"jsonwebtoken": "^8.5.1",
"lodash.difference": "^4.5.0",
"nats.ws": "^1.3.0",
"qs": "^6.9.4",
Expand Down
7 changes: 3 additions & 4 deletions src/iam.ts
Expand Up @@ -15,7 +15,7 @@
// @authors: Kim Honoridez
// @authors: Daniel Wojno

import { providers, Signer, utils, Wallet } from "ethers";
import { providers, Signer, utils } from "ethers";
import {
IRoleDefinition,
IAppDefinition,
Expand Down Expand Up @@ -71,7 +71,7 @@ import { addressOf } from "@ew-did-registry/did-ethr-resolver";
import { isValidDID, parseDID } from "./utils/did";
import { chainConfigs } from "./iam/chainConfig";
import { canonizeSig } from "./utils/enrollment";
import { JWT } from "@ew-did-registry/jwt";
import jwt from "jsonwebtoken";
const { id, keccak256, defaultAbiCoder, solidityKeccak256, arrayify, namehash } = utils;

export type InitializeData = {
Expand Down Expand Up @@ -577,8 +577,7 @@ export class IAM extends IAMBase {
blockNumber,
},
};
const jwt = new JWT(new Wallet(delegateKey));
const identityToken = jwt.sign(payload, { algorithm: "ES256" });
const identityToken = jwt.sign(payload, delegateKey);
return identityToken;
}

Expand Down

0 comments on commit cea0e8d

Please sign in to comment.