Add HttpPost Validate tenancy method
This commit is contained in:
parent
b17027163c
commit
5f38e0e3ef
@ -27,6 +27,7 @@ using Abp.Domain.Repositories;
|
||||
using System.Runtime.Intrinsics.X86;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using Abp.AutoMapper;
|
||||
|
||||
namespace BCS.BMC.Controllers
|
||||
{
|
||||
@ -246,14 +247,17 @@ namespace BCS.BMC.Controllers
|
||||
return SimpleStringCipher.Instance.Encrypt(accessToken);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[HttpPost]
|
||||
public async Task<ActionResult> ValidateTenancy([FromBody] GetUrlDto input)
|
||||
{
|
||||
Uri uri = new Uri(input.InputUrl, UriKind.Absolute);
|
||||
var domain = uri.Host;
|
||||
|
||||
if (input.InputUrl == null)
|
||||
{
|
||||
return BadRequest();
|
||||
}
|
||||
var company = await _companyMaster.FirstOrDefaultAsync(x => x.Url == input.InputUrl.ToString());
|
||||
var company = await _companyMaster.FirstOrDefaultAsync(x => x.Url == input.InputUrl.ToString() || x.DomainName == domain);
|
||||
if (company == null)
|
||||
{
|
||||
return BadRequest();
|
||||
|
Loading…
x
Reference in New Issue
Block a user