This commit is contained in:
2021-09-30 23:41:56 +00:00
parent 63bdaed629
commit ec67ecab23
4 changed files with 26 additions and 12 deletions

View File

@@ -352,6 +352,13 @@ namespace AyaNova.Api.Controllers
{
//customer type has special rights restrictions for UI features so return them here so client UI can enable or disable
var effectiveRights = await UserBiz.CustomerUserEffectiveRightsAsync(u.Id);
//A non active Customer or Head Office record's contacts are also not allowed to login
if (!effectiveRights.EntityActive)
{
log.LogInformation($"Customer contact user \"{u.Name}\" attempted login was denied due to inactive parent (Customer or HeadOffice)");
await Task.Delay(AyaNova.Util.ServerBootConfig.FAILED_AUTH_DELAY);
return StatusCode(401, new ApiErrorResponse(ApiErrorCode.AUTHENTICATION_FAILED));
}
return Ok(ApiOkResponse.Response(new
{
token = token,