<commit_before>#include "iotsaUser.h"
#include "iotsaConfigFile.h"
#include "iotsaStaticToken.h"

#undef PASSWORD_DEBUGGING	// Enables admin1/admin1 to always log in

class StaticToken {
public:
  String token;
  String rights;
};

IotsaStaticTokenMod::IotsaStaticTokenMod(IotsaApplication &_app, IotsaAuthenticationProvider &_chain)
:	chain(_chain),
	IotsaAuthMod(_app)
{
	configLoad();
}
	
void
IotsaStaticTokenMod::handler() {
  if (needsAuthentication("tokens")) return;
  if (server->hasArg("ntoken")) {
    ntoken = server->arg("ntoken").toInt();
    if (tokens) free(tokens);
    tokens = (StaticToken *)calloc(ntoken, sizeof(StaticToken));
     
    for (int i=0; i<ntoken; i++) {
      String tokenValue ;
      String tokenRights;
      tokens[i].token = server->arg("token" + String(i));
      tokens[i].rights = server->arg("rights" + String(i));<commit_msg>Fixed initialization order<commit_after>#include "iotsaUser.h"
#include "iotsaConfigFile.h"
#include "iotsaStaticToken.h"

#undef PASSWORD_DEBUGGING	// Enables admin1/admin1 to always log in

class StaticToken {
public:
  String token;
  String rights;
};

IotsaStaticTokenMod::IotsaStaticTokenMod(IotsaApplication &_app, IotsaAuthenticationProvider &_chain)
:	IotsaAuthMod(_app),
	chain(_chain)
{
	configLoad();
}
	
void
IotsaStaticTokenMod::handler() {
  if (needsAuthentication("tokens")) return;
  if (server->hasArg("ntoken")) {
    ntoken = server->arg("ntoken").toInt();
    if (tokens) free(tokens);
    tokens = (StaticToken *)calloc(ntoken, sizeof(StaticToken));
     
    for (int i=0; i<ntoken; i++) {
      String tokenValue ;
      String tokenRights;
      tokens[i].token = server->arg("token" + String(i));
      tokens[i].rights = server->arg("rights" + String(i));
{'fraction_non_alphanumeric': 0.14717626925270963, 'fraction_numerical': 0.0034227039361095267, 'mean_word_length': 4.866220735785953, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '1546759', 'n_tokens_mistral': 609, 'n_tokens_neox': 600, 'n_words': 119}