node-go/server/services/userValidate.js

14 lines
369 B
JavaScript
Raw Normal View History

2020-01-15 07:09:01 +00:00
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 };