Ejemplo n.º 1
0
        public async Task <IActionResult> CUSTOMER_LOGIN([FromBody] LoginCommand command)
        {
            var response = await _mediator.Send(command);

            var securityResp = await _identityServer.CheckForFailedTrailsAsync(response.Status.IsSuccessful, (int)Modules.CENTRAL, command.UserName);

            if (securityResp.Status.IsSuccessful)
            {
                if (response.Status.IsSuccessful)
                {
                    return(Ok(response));
                }
                await _identityService.UnlockUserAsync(command.UserName);

                return(BadRequest(response));
            }
            await _identityService.PerformLockFunction(command.UserName, securityResp.UnLockAt, securityResp.IsSecurityQuestion);

            return(BadRequest(securityResp));
        }