fix(core): update

This commit is contained in:
2021-02-09 10:26:42 +00:00
parent 566a07a6b5
commit 397b6f13a7
4 changed files with 10143 additions and 667 deletions

View File

@ -22,6 +22,7 @@ tap.test('should create a new jwt', async () => {
tap.test('should verify a jwt', async () => {
const data = await smartjwtInstance.verifyJWTAndGetData(testJwt);
console.log(data);
console.log(smartjwtInstance.publicKey.toPemString());
});
tap.test('should not verify a wrong jwt', async () => {
@ -38,4 +39,11 @@ tap.test('should not verify a wrong jwt', async () => {
expect(error).to.be.instanceOf(Error);
});
tap.test('should verify a jwt on another instance', async () => {
const secondSmartJwtInstance = new smartjwt.SmartJwt();
secondSmartJwtInstance.setPublicPemKeyForVerification(smartjwtInstance.publicKey.toPemString());
const result = secondSmartJwtInstance.verifyJWTAndGetData(testJwt);
console.log(result);
})
tap.start();