Skip to content

Commit d93ea49

Browse files
committed
jsonwebtoken - Updated SignCallback to match functionality correctly.
1 parent ab24621 commit d93ea49

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

jsonwebtoken/jsonwebtoken-tests.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ token = jwt.sign({ foo: 'bar' }, 'shhhhh');
2424
cert = fs.readFileSync('private.key'); // get private key
2525
token = jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256'});
2626

27+
// sign asynchronously
28+
jwt.sign({ foo: 'bar' }, cert, { algorithm: 'RS256' }, function(token: string) {
29+
console.log(token);
30+
});
31+
2732
/**
2833
* jwt.verify
2934
* https://github.com/auth0/node-jsonwebtoken#jwtverifytoken-secretorpublickey-options-callback

jsonwebtoken/jsonwebtoken.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Type definitions for jsonwebtoken 0.4.0
22
// Project: https://github.com/auth0/node-jsonwebtoken
3-
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>
3+
// Definitions by: Maxime LUCE <https://github.com/SomaticIT>, Daniel Heim <https://github.com/danielheim>
44
// Definitions: https://github.com/borisyankov/DefinitelyTyped
55

66
/// <reference path="../node/node.d.ts" />
@@ -53,7 +53,7 @@ declare module "jsonwebtoken" {
5353
}
5454

5555
export interface SignCallback {
56-
(err: Error, encoded: string): void;
56+
(encoded: string): void;
5757
}
5858

5959
/**

0 commit comments

Comments
 (0)