mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-04 12:10:30 +08:00
Add test cases for new VerifyOptions
This commit is contained in:
1 parent
5e14a5854d
commit
d18b076ae9
1 file changed
+12
@@ -57,6 +57,18 @@ jwt.verify(token, cert, { audience: 'urn:foo', issuer: 'urn:issuer' }, function(
|
||||
// if issuer mismatch, err == invalid issuer
|
||||
});
|
||||
|
||||
// verify algorithm
|
||||
cert = fs.readFileSync('public.pem'); // get public key
|
||||
jwt.verify(token, cert, { algorithms: ['RS256'] }, function(err, decoded) {
|
||||
// if issuer mismatch, err == invalid issuer
|
||||
});
|
||||
|
||||
// verify without expiration check
|
||||
cert = fs.readFileSync('public.pem'); // get public key
|
||||
jwt.verify(token, cert, { ignoreExpiration: true }, function(err, decoded) {
|
||||
// if issuer mismatch, err == invalid issuer
|
||||
});
|
||||
|
||||
/**
|
||||
* jwt.decode
|
||||
* https://github.com/auth0/node-jsonwebtoken#jwtdecodetoken
|
||||
|
||||
Reference in new issue
Block a user