I want to sanitize my user inputs, so that no xss is possible. I know that this works in PHP which is why it has to somehow work in node js aswell. I want to remove htmlchars, stripslashes and trim the userinput, but it somehow does not work.
I've tried express-validate, but with no effect at all. I've also tried express-sanitizer, which also did not work. And the I also tried a module called xss which didn't work aswell.
Can anyone help?
routing js:
router.post('/register', function(req, res, next) {
let regemail = req.body.EMailRegister,
reguser = req.body.UsernameRegister,
regpass = req.body.PasswordRegister,
regpassre = req.body.RepeatPasswordRegister;
I want to sanitize those variables, but it won't work.
Thanks in advance!