First of all thanks a lot for your post, I finally resolved the problem I faced since the last 3 months.
Just would like to add one more bit, since I was using passport alongside passport-jwt hence your solution didn't exactly work for me.
Here is what I used in the index.d.ts file
declare module 'express-serve-static-core' { export interface Request { user?: yourCustomType; } }
It might help someone else as well, but thanks a lot for guiding me in the right direction.
Thanks Bro
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
First of all thanks a lot for your post, I finally resolved the problem I faced since the last 3 months.
Just would like to add one more bit, since I was using passport alongside passport-jwt hence your solution didn't exactly work for me.
Here is what I used in the index.d.ts file
declare module 'express-serve-static-core' {
export interface Request {
user?: yourCustomType;
}
}
It might help someone else as well, but thanks a lot for guiding me in the right direction.
Thanks Bro