mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-07 16:30:12 +08:00
jsonwebtoken - Updated SignCallback to match functionality correctly.
This commit is contained in:
@@ -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
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
// Type definitions for jsonwebtoken 0.4.0
|
||||
// Project: https://github.com/auth0/node-jsonwebtoken
|
||||
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>
|
||||
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>, Daniel Heim <https://github.com/danielheim>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
@@ -53,7 +53,7 @@ declare module "jsonwebtoken" {
|
||||
}
|
||||
|
||||
export interface SignCallback {
|
||||
(err: Error, encoded: string): void;
|
||||
(encoded: string): void;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user