mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-10-28 12:30:21 +08:00
jsonwebtoken - Updated SignCallback to match functionality correctly.
This commit is contained in:
1 parent
ab2462147a
commit
d93ea49569
2 files changed
+7
-2
No files matched your search
@@ -24,6 +24,11 @@ token = jwt.sign({ foo: 'bar' }, 'shhhhh');
|
||||
cert = fs.readFileSync('private.key'); // get private key
|
||||
token = jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256'});
|
||||
|
||||
// sign asynchronously
|
||||
jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256' }, function(token: string) {
|
||||
console.log(token);
|
||||
});
|
||||
|
||||
/**
|
||||
* jwt.verify
|
||||
* https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback
|
||||
|
||||
Reference in new issue
Block a user