Feature/Auth: implement user authentication #3
@@ -15,13 +15,13 @@ public class ItemsController : ControllerBase {
|
||||
service_ = service;
|
||||
}
|
||||
|
||||
[AllowAnonymous] // accessible if not authorized
|
||||
[[Authorize]]
|
||||
[HttpGet]
|
||||
public async Task<ActionResult<List<Item>>> getItems() {
|
||||
return Ok(await service_.GetAll());
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[[Authorize]]
|
||||
[HttpGet("{id:int}")]
|
||||
public async Task<ActionResult<Item>> getItem(int id) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user