<commit_before>'use strict';

/**
 * This validator is responsible for
 * validating and tacking JWT usage
 *
 * @return {Object} validator functions
 */
module.exports = function(){
  var waterlock = this;

  return {

    /**
     * Validates a token
     *
     * @param  {String}   token the token to be validated
     * @param  {Function} cb    called when error has occured or token is validated
     */
    validateToken: function(token, cb){
      try{
        // decode the token
        var _token = waterlock.devicejwt.decode(token, waterlock.config.deviceJsonWebTokens.secret);

        // set the time of the request
        var _reqTime = Date.now();
<commit_msg>DeviceAuth: Fixed an issue with token not being parsed.<commit_after>'use strict';

/**
 * This validator is responsible for
 * validating and tacking JWT usage
 *
 * @return {Object} validator functions
 */
module.exports = function(){
  var waterlock = this;

  return {

    /**
     * Validates a token
     *
     * @param  {String}   token the token to be validated
     * @param  {Function} cb    called when error has occured or token is validated
     */
    validateToken: function(token, cb){
      try{
        // decode the token
        var _token = waterlock.jwt.decode(token, waterlock.config.deviceJsonWebTokens.secret);

        // set the time of the request
        var _reqTime = Date.now();

{'fraction_non_alphanumeric': 0.09640287769784173, 'fraction_numerical': 0.0, 'mean_word_length': 2.566666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4963129', 'n_tokens_mistral': 399, 'n_tokens_neox': 389, 'n_words': 138}