When using Passport with Express, Typescript thinks req.user is possibly undefined inside a route when using an auth middleware. When using an auth middleware, I'd like req.user to be defined in all cases because otherwise, the middleware will return 401 unauthorized response.
If the route is using an auth middleware like this:
app.use( '/users', passport.authenticate('bearer', { session: false }), usersRouter );
The routes within /users shouldn't have the user being possibly undefined since it never will be.
How does one achieve this, without declaring a custom request interface to use for each route?