<commit_before>var express = require('express');

var usersRouter = function (router, User, multipartMiddleware) {
  router.post('/api/user/register', multipartMiddleware, function (req, res) {
    var firstname = req.body.firstname;
    var lastname = req.body.lastname;
    var username = req.body.username;
    var email = req.body.email;
    var password = <PASSWORD>;
    var time = new Date();

    var user = {
      firstname: firstname,
      lastname: lastname,
      username: username,
      email: email,
      password: password,
      datetime: time,
    };

    var newUser = new User(user);

    newUser.save(function (err, docs) {
      if (err) console.log(err);

      console.log(docs);
      res.json({
        status: 'done',
      });
    });

  })

  .get('/api/user/login', function (req, res) {
    var username = req.query.username;
    var password = <PASSWORD>;

    User.find({ username: username, password: password }, function (err, docs) {
      if (err)

      if (docs != null) {
        res.json({ status: 'authorized' });
      } else {
        res.json({ status: 'unauthorized' });<commit_msg>fix login<commit_after>var express = require('express');

var usersRouter = function (router, User, multipartMiddleware) {
  router.post('/api/user/register', multipartMiddleware, function (req, res) {
    var firstname = req.body.firstname;
    var lastname = req.body.lastname;
    var username = req.body.username;
    var email = req.body.email;
    var password = <PASSWORD>;
    var time = new Date();

    var user = {
      firstname: firstname,
      lastname: lastname,
      username: username,
      email: email,
      password: password,
      datetime: time,
    };

    var newUser = new User(user);

    newUser.save(function (err, docs) {
      if (err) console.log(err);

      console.log(docs);
      res.json({
        status: 'done',
      });
    });

  })

  .get('/api/user/login', function (req, res) {
    var username = req.query.username;
    var password = <PASSWORD>.query.password;

    console.log(username);

    User.find({ username: username, password: password }, function (err, docs) {
      if (err) console.log(err);

      if (docs) {
        res.json({ status: 'authorized' });
      } else {
        res.json({ status: 'unauthorized' });
{'fraction_non_alphanumeric': 0.143536532641591, 'fraction_numerical': 0.0, 'mean_word_length': 2.587596899224806, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4284652', 'n_tokens_mistral': 719, 'n_tokens_neox': 701, 'n_words': 184}