mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-03-28 19:20:26 +00:00
fix(ui): allow case-insensitive username (#1249)
This commit is contained in:
parent
f21b1951b4
commit
91460f3c72
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user