Added some minor tweaks, and set up the EmployeeController to be usable by a frontend to see how well all this works so far.
This commit is contained in:
@@ -24,19 +24,19 @@ namespace SecureCore.Controllers
|
||||
[HttpGet]
|
||||
public IActionResult Get()
|
||||
{
|
||||
//if (Authentication.IsAllowed(HttpContext))
|
||||
return Ok(DataService.Get());
|
||||
//else
|
||||
// return Unauthorized();
|
||||
if(SessionManager.IsSessionTokenValid(HttpContext))
|
||||
return Ok(DataService.Get());
|
||||
else
|
||||
return Unauthorized();
|
||||
}
|
||||
|
||||
[HttpGet("{id}", Name = "Get")]
|
||||
public IActionResult Get(int id)
|
||||
{
|
||||
//if (Authentication.IsAllowed(HttpContext))
|
||||
return Ok(DataService.GetById(id));
|
||||
//else
|
||||
// return Unauthorized();
|
||||
if (SessionManager.IsSessionTokenValid(HttpContext))
|
||||
return Ok(DataService.GetById(id));
|
||||
else
|
||||
return Unauthorized();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user