Skip to content
Advertisement

Tag: prism

Get user data in request.user using express and typescript

I’m trying to create a middleware to ensure the user is admin, but when I print request.customer, the result is undefined. This is what I’m doing: request.customer returns this: Property ‘customer’ does not exist on type ‘Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>’ So I declared the express namespace by adding the customer id, like this: I have no errors but

Advertisement