2 Commits

1 changed files with 12 additions and 2 deletions
Split View
  1. +12
    -2
      BCS.BMC/src/BCS.BMC.Web.Core/Controllers/TokenAuthController.cs

+ 12
- 2
BCS.BMC/src/BCS.BMC.Web.Core/Controllers/TokenAuthController.cs View File

@ -282,7 +282,7 @@ namespace BCS.BMC.Controllers
var protocol = "";
if (string.IsNullOrWhiteSpace(input.CompanyUrl))
{
return BadRequest("Please Enter A Valid Url");
return BadRequest("Please enter a valid Url");
}
using (HttpClient client = new HttpClient())
{
@ -305,6 +305,11 @@ namespace BCS.BMC.Controllers
{
return BadRequest("Invalid Company Url");
}
var companyAccountId = await _companyMaster.FirstOrDefaultAsync(x => x.CompanyName == input.CompanyId);
if (companyAccountId == null)
{
return BadRequest("Please enter valid Company Account ID");
}
// var baseUrl = uri + "api/BmcLogin";
var baseUrl = protocol + "://" + host + "/api/BmcLogin";
@ -347,7 +352,7 @@ namespace BCS.BMC.Controllers
var contents = await response.Content.ReadAsStringAsync();
ResponseMessageModel result = JsonConvert.DeserializeObject<ResponseMessageModel>(contents);
return BadRequest(result.error.message == "Login Failed" ? "Invalid Username Or Password" : result.error.message);
return BadRequest(result.error.message == "Login Failed" ? "Please enter valid Username or Password" : result.error.message);
}
return Ok();
}
@ -368,6 +373,11 @@ namespace BCS.BMC.Controllers
{
return BadRequest("Url Not Found");
}
var companyAccountId = await _companyMaster.FirstOrDefaultAsync(x => x.CompanyName == input.CompanyAccountId);
if (companyAccountId == null)
{
return BadRequest("Please enter valid Company Account ID");
}
using (HttpClient client = new HttpClient())
{
var baseUrl = input.CompanyUrl + "/api/services/bwac/employeeRegister/RegisterEmployeeAsNewUser";


Loading…
Cancel
Save