Browse Source

BMC: Validation Message For Company Id in Login API

feature/ModificationForSentNotificationAPI
Palash Biswas 2 years ago
parent
commit
9ecc2c1825
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      BCS.BMC/src/BCS.BMC.Web.Core/Controllers/TokenAuthController.cs

+ 6
- 1
BCS.BMC/src/BCS.BMC.Web.Core/Controllers/TokenAuthController.cs View File

@ -282,7 +282,7 @@ namespace BCS.BMC.Controllers
var protocol = ""; var protocol = "";
if (string.IsNullOrWhiteSpace(input.CompanyUrl)) if (string.IsNullOrWhiteSpace(input.CompanyUrl))
{ {
return BadRequest("Please Enter A Valid Url");
return BadRequest("Please enter a valid Url");
} }
using (HttpClient client = new HttpClient()) using (HttpClient client = new HttpClient())
{ {
@ -305,6 +305,11 @@ namespace BCS.BMC.Controllers
{ {
return BadRequest("Invalid Company Url"); 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 = uri + "api/BmcLogin";
var baseUrl = protocol + "://" + host + "/api/BmcLogin"; var baseUrl = protocol + "://" + host + "/api/BmcLogin";


Loading…
Cancel
Save