fastify-jwt icon indicating copy to clipboard operation
fastify-jwt copied to clipboard

Add documentation about changes in fastify.jwt object while using namespaces

Open jmartinacu opened this issue 2 years ago • 3 comments

Prerequisites

  • [X] I have written a descriptive issue title
  • [X] I have searched existing issues to ensure the issue has not already been raised

Issue

Hello, I was using fastify-jwt to implement a authorization strategy with accessToken and refreshToken using the namespace feature. But when I had to use the functionality of fastify.jwt instead of the default function <namespace>JwtVerify or <namespace>JwtSign defined in the documentation, there wasn't any information about the changes that are applied to fastify.jwt when you use namespaces.

jmartinacu avatar Apr 11 '23 17:04 jmartinacu

Thanks for reporting! Would you like to send a Pull Request to address this issue?

Eomm avatar Apr 12 '23 09:04 Eomm

The documentation has been updated along with #297. It may cover your issue

piotr-cz avatar Jul 06 '23 09:07 piotr-cz

I suppose it would be good to know about how to use .jwtVerify() with namespaces, because all of the .{namespace}JwtVerify functions require token: string, contrary to the default function (They are bound to FastifyInstance, instead of FastifyRequest, as well). It is also unclear on how to use it with cookies, for example.

I can set up a new Issue if this is not an intended behavior.

limtis0 avatar Mar 14 '24 05:03 limtis0