Change basic auth setup

This commit is contained in:
2023-03-19 17:22:00 +02:00
parent cc62b8f19f
commit f68a09c1a8

View File

@@ -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