From f68a09c1a85a41fe6a5a9bc3a046e6ff016a8250 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Veikko=20Lintuj=C3=A4rvi?= Date: Sun, 19 Mar 2023 17:22:00 +0200 Subject: [PATCH] Change basic auth setup --- lib/osuuspuutarha_web/router.ex | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/lib/osuuspuutarha_web/router.ex b/lib/osuuspuutarha_web/router.ex index ea9094a..ed4859a 100644 --- a/lib/osuuspuutarha_web/router.ex +++ b/lib/osuuspuutarha_web/router.ex @@ -79,19 +79,8 @@ defmodule OsuuspuutarhaWeb.Router do end defp auth(conn, _opts) do - username = - if Mix.env() == :prod do - System.fetch_env!("BA_USERNAME") - else - "dev" - end - - password = - if Mix.env() == :prod do - System.fetch_env!("BA_PASSWORD") - else - "dev" - end + username = System.fetch_env!("BA_USERNAME") + password = System.fetch_env!("BA_PASSWORD") Plug.BasicAuth.basic_auth(conn, username: username, password: password) end