public IActionResult AuthenticateUser([FromBody] LoginDetail loginDetail) { _log4net.Info(" Http Authentication request Initiated"); var token = loginRepo.AuthenticateUser(loginDetail.Username, loginDetail.Password); if (token == null) { return(Unauthorized()); } return(Ok(token)); }
public UserModel AuthenticateUser(UserModel login) { Cipher cp = new Cipher(); string encPassword = cp.EncryptPasswd(login.Passwd); login.Passwd = encPassword; //int result = CheckUserActive(login, connectionString); //if (result == 1) //{ return(_loginRepo.AuthenticateUser(login)); //} //else //{ return null; } //_loginRepo.AuthenticateUser(login, connectionString); //return user; }