2 Commits

Author SHA1 Message Date
67bba6335c 1.0.7 2019-10-01 19:22:02 +02:00
eaef5d3d78 fix(core): update 2019-10-01 19:22:02 +02:00
3 changed files with 16 additions and 3 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartjwt",
"version": "1.0.6",
"version": "1.0.7",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartjwt",
"version": "1.0.6",
"version": "1.0.7",
"private": false,
"description": "a package for handling jwt",
"main": "dist/index.js",

View File

@ -24,5 +24,18 @@ tap.test('should verify a jwt', async () => {
console.log(data);
});
tap.test('should not verify a wrong jwt', async () => {
const jwt2 = await smartjwtInstance.createJWT({ wow: 'soclear' });
const jwt2Array = jwt2.split('.');
const testJwtArray = testJwt.split('.');
const newJwt = `${testJwtArray[0]}.${jwt2Array[1]}.${testJwtArray[2]}`;
let error: Error;
try {
await smartjwtInstance.verifyJWTAndGetData(newJwt);
} catch (e) {
error = e;
}
expect(error).to.be.instanceOf(Error);
});
tap.start();