authenticate root user via configHelper
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user