authenticate root user via configHelper

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-03-02 07:11:54 -07:00
parent bf14e4c8c0
commit f69b789346
2 changed files with 13 additions and 15 deletions

View File

@@ -10,6 +10,7 @@ namespace CarCareTracker.Helper
OpenIDConfig GetOpenIDConfig();
UserConfig GetUserConfig(ClaimsPrincipal user);
bool SaveUserConfig(ClaimsPrincipal user, UserConfig configData);
bool AuthenticateRootUser(string username, string password);
string GetLogoUrl();
string GetServerLanguage();
bool GetServerEnableShopSupplies();
@@ -43,6 +44,12 @@ namespace CarCareTracker.Helper
}
return logoUrl;
}
public bool AuthenticateRootUser(string username, string password)
{
var rootUsername = _config["UserNameHash"];
var rootPassword = _config["UserPasswordHash"];
return username == rootUsername && password == rootPassword;
}
public string GetServerLanguage()
{
var serverLanguage = _config[nameof(UserConfig.UserLanguage)] ?? "en_US";