<commit_before>var Database = require('../persistence/mongo');
var db = new Database();
var isJson = require('../utils/common').isJson;
var model = require('../models');

module.exports = function (app) {
  return function (client) {
    var auth = {};
    var userInfo = {};
    var unsubscribeAll = function () {

    };

    client.on('connect', function (packet) {
      client.id = packet.client;
      if (packet.username === undefined || packet.password === undefined) {
        return client.connack({
          returnCode: -1
        });
      }
      auth['name'] = packet.username;
      auth['password'] = packet.password.<PASSWORD>();
      client.id = packet.client;
      model.User.findOne({where: {name: auth.name}}).then(function (user) {
        if (!user) {
          return client.connack({
            returnCode: -1
          });
        }<commit_msg>Update mqtt query<commit_after>var Database = require('../persistence/mongo');
var db = new Database();
var isJson = require('../utils/common').isJson;
var model = require('../models');

module.exports = function (app) {
  return function (client) {
    var auth = {};
    var userInfo = {};
    var unsubscribeAll = function () {

    };

    client.on('connect', function (packet) {
      client.id = packet.client;
      if (packet.username === undefined || packet.password === undefined) {
        return client.connack({
          returnCode: -1
        });
      }
      auth['name'] = packet.username;
      auth['password'] = <PASSWORD>.<PASSWORD>();
      client.id = packet.client;
      model.User.findOne({name: auth.name}).then(function (user) {
        if (!user) {
          return client.connack({
            returnCode: -1
          });
        }
{'fraction_non_alphanumeric': 0.16570771001150747, 'fraction_numerical': 0.0023014959723820483, 'mean_word_length': 2.376699029126214, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '7008917', 'n_tokens_mistral': 496, 'n_tokens_neox': 492, 'n_words': 113}