replaced IConfiguration injection with IConfigHelper

This commit is contained in:
DESKTOP-GENO133\IvanPlex
2024-01-14 09:54:13 -07:00
parent 8c6920afab
commit 8d74799099
16 changed files with 137 additions and 71 deletions

View File

@@ -19,6 +19,7 @@ namespace CarCareTracker.Logic
OperationResponse ResetPasswordByUser(LoginModel credentials);
OperationResponse ResetUserPassword(LoginModel credentials);
UserData ValidateUserCredentials(LoginModel credentials);
bool CheckIfUserIsValid(int userId);
bool CreateRootUserCredentials(LoginModel credentials);
bool DeleteRootUserCredentials();
List<UserData> GetAllUsers();
@@ -36,6 +37,21 @@ namespace CarCareTracker.Logic
_tokenData = tokenData;
_mailHelper = mailHelper;
}
public bool CheckIfUserIsValid(int userId)
{
if (userId == -1)
{
return true;
}
var result = _userData.GetUserRecordById(userId);
if (result == null)
{
return false;
} else
{
return result.Id != 0;
}
}
//handles user registration
public OperationResponse RegisterNewUser(LoginModel credentials)
{