microsoft / TypeScript-Node-Starter

A reference example for TypeScript and Node with a detailed README describing how to use the two together.
MIT License
11.31k stars 2.77k forks source link

express validator isn't doing anything #251

Open CameronSima opened 4 years ago

CameronSima commented 4 years ago

These lines wont do anything:

export const postLogin = (req: Request, res: Response, next: NextFunction) => { check("email", "Email is not valid").isEmail() check("password", "Password cannot be blank").isLength({min: 1})

the checks() are middleware, they need to be in the middleware chain, not in the middle of a function