Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save wellingtonjhn/4f878b2ebe7f261e0e65b32022922ff2 to your computer and use it in GitHub Desktop.

Select an option

Save wellingtonjhn/4f878b2ebe7f261e0e65b32022922ff2 to your computer and use it in GitHub Desktop.
Accounts Controller - Refresh Token
[Route("api/[controller]")]
public class AccountsController : Controller
{
private readonly IMediator _mediator;
public AccountsController(IMediator mediator)
{
_mediator = mediator;
}
[HttpPost, AllowAnonymous, Route("login")]
public async Task<IActionResult> Authenticate([FromBody] Authenticate command)
{
var response = await _mediator.Send(command);
if (response.HasMessages)
{
return BadRequest(response.Messages);
}
return Ok(response.Value);
}
// ... código omitido
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment