Skip to content

Commit

Permalink
Automatizando a insercao da claim do produto detalhe
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroMF1996 committed Oct 25, 2023
1 parent 9833b2f commit b4d026e
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ public async Task<IActionResult> Registrar(RegisterUserViewModel model)
if (result.Succeeded)
{
var clienteResult = await RegistrarCliente(model);

if (!clienteResult.ValidationResult.IsValid)
{
await _userManager.DeleteAsync(user);
return CustomResponse(clienteResult.ValidationResult);
}

await _userManager.AddClaimAsync(user, new Claim("catalogo", "Ler"));

return CustomResponse(await GerarJWT(model.Email));
}

Expand Down

0 comments on commit b4d026e

Please sign in to comment.