node-go/packages/play-node-go/server/services/userValidate.js
2020-02-05 16:44:31 -08:00

14 lines
No EOL
369 B
JavaScript

const validateSignup = (user) => {
if (!user.username) throw('no username');
if (!user.email) throw('no email');
if (!user.password) throw('no password');
return true
}
const validateLogin = (user) => {
if (!user.username) throw('no username');
if (!user.password) throw('no password');
return true;
}
module.exports = { validateLogin, validateSignup };