Skip to content

Commit

Permalink
fix: add missing lookupToken to the type (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
salmanm authored Aug 2, 2022
1 parent 0c71d16 commit 6c3f544
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions jwt.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ export interface JWT {
verify<Decoded extends VerifyPayloadType>(token: string, options: Partial<VerifyOptions>, callback: VerifierCallback): void

decode<Decoded extends DecodePayloadType>(token: string, options?: Partial<DecoderOptions>): null | Decoded

lookupToken(request: fastify.FastifyRequest, options?: FastifyJWTOptions['verify']): string
}

export type { JwtHeader } from 'fast-jwt'
Expand Down
1 change: 1 addition & 0 deletions test/types/jwt.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ expectAssignable<object>(app.jwt)
expectAssignable<Function>(app.jwt.sign)
expectAssignable<Function>(app.jwt.verify)
expectAssignable<Function>(app.jwt.decode)
expectAssignable<Function>(app.jwt.lookupToken)
expectAssignable<FastifyJWTOptions['cookie']>(app.jwt.cookie)

app.addHook("preHandler", async (request, reply) => {
Expand Down

0 comments on commit 6c3f544

Please sign in to comment.