Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.post('/api/auth/', function (req, res){
- return UsersModel.find({ username: req.body.username }, function (err, users) {
- if(!users) {
- res.statusCode = 404;
- return res.send({ status: 'false', error: 'User not found' });
- }
- if (users.pass === req.body.pass) {
- log.info("pass normal");
- return res.send({ status: 'true', error: 'User verified' });
- } else {
- res.statusCode = 404;
- log.error('Password is wrong');
- return res.send({ status: 'false', error: 'Password is wrong' });
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement