From febaf21c0d24e50bcde81718fd7d1c46e23b2f0e Mon Sep 17 00:00:00 2001 From: MangosArentLiterature <58055358+MangosArentLiterature@users.noreply.github.com> Date: Sat, 3 Apr 2021 17:00:45 -0500 Subject: [PATCH] Check for correct auth_type in config.ini When initializing config.ini, ensure auth_type is set to a recognzied value. --- src/config_manager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/config_manager.cpp b/src/config_manager.cpp index 69de3cf..d6893a8 100644 --- a/src/config_manager.cpp +++ b/src/config_manager.cpp @@ -84,6 +84,14 @@ bool ConfigManager::initConfig() // This means the config is invalid return false; } + config.beginGroup("Options"); + QString auth_type = config.value("auth", "simple").toString(); + config.endGroup(); + if (!(auth_type == "simple" || auth_type == "advanced")) { + qCritical() << "config.ini is invalid!"; + return false; + } + else { // Config is valid and up to date, so let's go ahead return true;