2021-05-03 01:30:06 +02:00
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
|
|
namespace HanyadikHetVan.Controllers
|
|
|
|
|
{
|
|
|
|
|
[Route("api/test")]
|
|
|
|
|
[ApiController]
|
|
|
|
|
public class TestController : ControllerBase
|
|
|
|
|
{
|
|
|
|
|
[HttpGet("unprotected")]
|
|
|
|
|
public string Unprotected()
|
|
|
|
|
{
|
|
|
|
|
|
2021-05-03 15:56:38 +02:00
|
|
|
|
return "Unprotected";
|
2021-05-03 01:30:06 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Authorize]
|
|
|
|
|
[HttpGet("protected")]
|
|
|
|
|
public string Protected()
|
|
|
|
|
{
|
|
|
|
|
|
2021-05-03 15:56:38 +02:00
|
|
|
|
return "Protected";
|
2021-05-03 01:30:06 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|