validateRequest method

Future<void> validateRequest(
  1. String? testPassword,
  2. String? database
)

Implementation

Future<void> validateRequest(String? testPassword, String? database) async {
  testMode = false;
  if (testPassword != null) {
    if (testPassword == C_TEST_PASSWORD) {
      testMode = true;
    } else {
      throw RemoteStatusException(RemoteStatus.INVALID_TEST_MODE);
    }
  }
  if (!testMode) {
    database = null;
  }
  AbstractPool dbPool = poolStore.getMySqlPool(database);
  userTools = poolStore.getUserTools(database);
  transaction = DbTransaction(dbPool);
  try {
    await transaction.beginTransaction();
    transactionBegun=true;
  } catch (e) {
    print("WS $e");
  }
}