import { Request, Response, NextFunction } from 'express'; import { authenticateUser } from '../services/authentication.service'; export async function currentUser(req: Request, _res: Response, next: NextFunction): Promise { req.user = await authenticateUser({ authorization: req.header('authorization'), demoEmail: req.header('x-user-email'), }); next(); }