You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How can I make TypeScript understand that I have a new property jwtUser?
I have tried the following but it doesn't seem to work:
// fastify-jwt.d.tsimport'@fastify/jwt';importtype{ObjectId}from'mongodb';typeUserPayload={id: ObjectId};typeDecodedUser=UserPayload;declare module '@fastify/jwt'{interfaceFastifyJWT{// payload type is used for signing and verifyingpayload: UserPayload;// user type is return type of `request.user` objectjwtUser: DecodedUser;}interfaceFastifyRequest{jwtUser: DecodedUser;}}declare module 'fastify'{interfaceFastifyInstance{authenticate: FastifyMiddleware;}}
Link to code that reproduces the bug
No response
Expected Behavior
No response
The content you are editing has changed. Please copy your edits and refresh the page.
Prerequisites
Fastify version
4.28.1
Plugin version
8.0.1
Node.js version
using Bun
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
24.04
Description
How can I make TypeSciprt understand the new decorator for my custom decorator name?
For example if I have the following:
How can I make TypeScript understand that I have a new property jwtUser?
I have tried the following but it doesn't seem to work:
Link to code that reproduces the bug
No response
Expected Behavior
No response
Tasks
The text was updated successfully, but these errors were encountered: