fix jwt.decode signature

This commit is contained in:
Jannik Keye
2018-09-21 15:19:17 +02:00
parent a87e2aea63
commit 0e96ec20cb
3 changed files with 5 additions and 4 deletions
+1
View File
@@ -60,6 +60,7 @@ fastify.jwt.sign(9999, {}, (err, token) => {
return token;
});
fastify.jwt.decode("some-token");
fastify.jwt.decode("some-token");
fastify.jwt.secret = "some-secret";
fastify.jwt.verify("some-token", {}, (err) => {
+3 -3
View File
@@ -4,7 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import { SignOptions, VerifyOptions, VerifyCallback, SignCallback, DecodeOptions } from 'jsonwebtoken';
import { Secret, SignOptions, VerifyOptions, VerifyCallback, SignCallback, DecodeOptions } from 'jsonwebtoken';
export interface FastifyInstance<HttpServer, HttpRequest, HttpResponse> {
jwt: jwt;
@@ -13,8 +13,8 @@ export interface FastifyInstance<HttpServer, HttpRequest, HttpResponse> {
export interface jwt {
sign: (payload: any, options?: SignOptions, callback?: SignCallback) => string;
verify: (token: string, options?: VerifyOptions, callback?: VerifyCallback) => string;
decode: (token: string, options?: DecodeOptions) => string;
secret: string;
decode: (token: string, options?: DecodeOptions) => null | { [key: string]: any } | string;
secret: Secret;
}
export interface FastifyRequest<HttpRequest> {
+1 -1
View File
@@ -6,7 +6,7 @@
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictNullChecks": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [