Started to try and organize all the authentication code.
This commit is contained in:
@@ -5,8 +5,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using SecureCore.Services;
|
||||
using System.Security.Cryptography;
|
||||
using Microsoft.AspNetCore.Cryptography.KeyDerivation;
|
||||
using SecureCore.Authentication;
|
||||
|
||||
namespace SecureCore.Controllers
|
||||
{
|
||||
@@ -25,19 +24,19 @@ namespace SecureCore.Controllers
|
||||
[HttpGet]
|
||||
public IActionResult Get()
|
||||
{
|
||||
if (Authentication.IsAllowed(HttpContext))
|
||||
return Ok(DataService.Get());
|
||||
else
|
||||
return Unauthorized();
|
||||
//if (Authentication.IsAllowed(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 (Authentication.IsAllowed(HttpContext))
|
||||
return Ok(DataService.GetById(id));
|
||||
//else
|
||||
// return Unauthorized();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user