From 91460f3c724a0fe1c1fa56c627378d929902e207 Mon Sep 17 00:00:00 2001 From: ReenigneArcher <42013603+ReenigneArcher@users.noreply.github.com> Date: Sat, 6 May 2023 08:45:35 -0400 Subject: [PATCH] fix(ui): allow case-insensitive username (#1249) --- src/confighttp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/confighttp.cpp b/src/confighttp.cpp index e442d6b0..62fe6800 100644 --- a/src/confighttp.cpp +++ b/src/confighttp.cpp @@ -128,7 +128,7 @@ namespace confighttp { auto password = authData.substr(index + 1); auto hash = util::hex(crypto::hash(password + config::sunshine.salt)).to_string(); - if (username != config::sunshine.username || hash != config::sunshine.password) { + if (!boost::iequals(username, config::sunshine.username) || hash != config::sunshine.password) { return false; } @@ -631,7 +631,7 @@ namespace confighttp { } else { auto hash = util::hex(crypto::hash(password + config::sunshine.salt)).to_string(); - if (config::sunshine.username.empty() || (username == config::sunshine.username && hash == config::sunshine.password)) { + if (config::sunshine.username.empty() || (boost::iequals(username, config::sunshine.username) && hash == config::sunshine.password)) { if (newPassword.empty() || newPassword != confirmPassword) { outputTree.put("status", false); outputTree.put("error", "Password Mismatch");