Exemplo n.º 1
0
        public async Task <IActionResult> LoginCliente([FromBody] LoginDto login)
        {
            if (!ModelState.IsValid)
            {
                return(CustomResponse(ModelState));
            }

            var cliente = await _contaService.AutenticarCliente(login.Email, login.Senha);

            if (!OperacaoValida())
            {
                return(CustomResponse());
            }

            return(CustomResponse(await _authService.ObterResponseToken(new UsuarioResponseDto(cliente.Usuario.Id, cliente.Email.Endereco))));
        }