use iconfiguration for app passphrase
This commit is contained in:
parent
2e4903481c
commit
38287093b4
@ -8,6 +8,13 @@ namespace BinaryDad.Notes.Controllers
|
|||||||
{
|
{
|
||||||
public class LoginController : Controller
|
public class LoginController : Controller
|
||||||
{
|
{
|
||||||
|
private readonly IConfiguration configuration;
|
||||||
|
|
||||||
|
public LoginController(IConfiguration configuration)
|
||||||
|
{
|
||||||
|
this.configuration = configuration;
|
||||||
|
}
|
||||||
|
|
||||||
[Route("login")]
|
[Route("login")]
|
||||||
public IActionResult Login()
|
public IActionResult Login()
|
||||||
{
|
{
|
||||||
@ -21,7 +28,7 @@ namespace BinaryDad.Notes.Controllers
|
|||||||
{
|
{
|
||||||
if (ModelState.IsValid)
|
if (ModelState.IsValid)
|
||||||
{
|
{
|
||||||
var appPassphrase = Environment.GetEnvironmentVariable("APP_PASSPHRASE");
|
var appPassphrase = configuration["APP_PASSPHRASE"];
|
||||||
|
|
||||||
if (passphrase == appPassphrase)
|
if (passphrase == appPassphrase)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user