phronCare/phronCare.API/Controllers/TestController.cs
Leandro Hernan Rojas c80da65dac
All checks were successful
CI/CD Pipeline / Build and Deploy with Docker Compose (push) Successful in 5m47s
Patch JWT
2025-04-28 18:43:59 -03:00

30 lines
842 B
C#

using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace phronCare.API.Controllers
{
//[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)]
[Route("api/[controller]")]
[ApiController]
public class TestController : ControllerBase
{
[Authorize(Roles = "User")]
[HttpGet("empleados")]
public IEnumerable<string> GetEmpleados()
{
return new List<string> { "SOS USUARIO", "Griselda", "Agustin","Victoria" };
}
[Authorize (Roles ="Admin")]
[HttpGet("administradores")]
public IEnumerable<string> GetAdministradores()
{
return new List<string> { "SOS ADMINISTRADOR", "Griselda", "Agustin", "Victoria" };
}
}
}