From d93ea495690e1c07fb09267a43a7480871498a2a Mon Sep 17 00:00:00 2001 From: Daniel Heim Date: Thu, 25 Feb 2016 22:04:39 +1100 Subject: [PATCH] jsonwebtoken - Updated SignCallback to match functionality correctly. --- jsonwebtoken/jsonwebtoken-tests.ts | 5 +++++ jsonwebtoken/jsonwebtoken.d.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/jsonwebtoken/jsonwebtoken-tests.ts b/jsonwebtoken/jsonwebtoken-tests.ts index f4f63a12c..d7ac4c8e2 100644 --- a/jsonwebtoken/jsonwebtoken-tests.ts +++ b/jsonwebtoken/jsonwebtoken-tests.ts @@ -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 diff --git a/jsonwebtoken/jsonwebtoken.d.ts b/jsonwebtoken/jsonwebtoken.d.ts index b5a2708d2..a047acf95 100644 --- a/jsonwebtoken/jsonwebtoken.d.ts +++ b/jsonwebtoken/jsonwebtoken.d.ts @@ -1,6 +1,6 @@ // Type definitions for jsonwebtoken 0.4.0 // Project: https://github.com/auth0/node-jsonwebtoken -// Definitions by: Maxime LUCE +// Definitions by: Maxime LUCE , Daniel Heim // Definitions: https://github.com/borisyankov/DefinitelyTyped /// @@ -53,7 +53,7 @@ declare module "jsonwebtoken" { } export interface SignCallback { - (err: Error, encoded: string): void; + (encoded: string): void; } /**