<commit_before>var _ = require('lodash');
var error = require('../config/error.js');
var express = require('express');
var router = express.Router();
var mongoose = require('mongoose');
var Usuario = require('../models/Usuario.js');

/* POST /login/ */
router.post('/', function(req, res, next) {
  var user = 
    Usuario.find( { email: req.body.email, senha: req.body.senha }, 'nome email' , function (err, post) {
      if (err) return res.status(400).json(err);
      if(post.length > 0) {
        res.status(202).json(_.assign({}, { auth: true }, post[0]._doc ));
      } else {
        res.status(404).json({ auth: false });
      }
    })
    .limit(1)
    .select({ email: 1, occupation: 1 });
});<commit_msg>changing http status<commit_after>var _ = require('lodash');
var error = require('../config/error.js');
var express = require('express');
var router = express.Router();
var mongoose = require('mongoose');
var Usuario = require('../models/Usuario.js');

/* POST /login/ */
router.post('/', function(req, res, next) {
  var user = 
    Usuario.find( { email: req.body.email, senha: req.body.senha }, 'nome email' , function (err, post) {
      if (err) return res.status(400).json(err);
      if(post.length > 0) {
        res.status(200).json(_.assign({}, { auth: true }, post[0]._doc ));
      } else {
        res.status(404).json({ auth: false });
      }
    })
    .limit(1)
    .select({ email: 1, occupation: 1 });
});
{'fraction_non_alphanumeric': 0.20680083275503122, 'fraction_numerical': 0.01943095072866065, 'mean_word_length': 3.1082621082621085, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5499360', 'n_tokens_mistral': 511, 'n_tokens_neox': 490, 'n_words': 112}