mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
fix jwt.decode signature
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Vendored
+3
-3
@@ -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> {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictNullChecks": false,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
|
||||
Reference in New Issue
Block a user