Started to try and organize all the authentication code.

This commit is contained in:
2021-01-03 22:09:36 -06:00
parent ddb42da7bb
commit e03610e390
16 changed files with 174 additions and 91 deletions
+9 -10
View File
@@ -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();
}
}