Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 1x | function errorValidator (reply, errorMessage, action, email, password) { const nonce = { scriptN: reply.cspNonce.script, styleN: reply.cspNonce.style } switch (errorMessage) { case 'body/email must match pattern "^\\S+@\\S+\\.\\S+$"': return reply.code(400).view('session.hbs', { error: 'please enter a valid email', button: action, action: '/' + action, email, password, ...nonce }) case 'body/password must NOT have fewer than 5 characters': return reply.code(400).view('session.hbs', { error: 'password is to short', button: action, action: '/' + action, email, password, ...nonce }) case 'body/url must match pattern "^(ftp|http|https):[^ "]+$"': return reply.code(409).view('error.hbs', { message: '400', subtitle: 'Please enter a valid url', ...nonce }) } } module.exports = errorValidator |