Change basic auth setup
This commit is contained in:
@@ -79,19 +79,8 @@ defmodule OsuuspuutarhaWeb.Router do
|
|||||||
end
|
end
|
||||||
|
|
||||||
defp auth(conn, _opts) do
|
defp auth(conn, _opts) do
|
||||||
username =
|
username = System.fetch_env!("BA_USERNAME")
|
||||||
if Mix.env() == :prod do
|
password = System.fetch_env!("BA_PASSWORD")
|
||||||
System.fetch_env!("BA_USERNAME")
|
|
||||||
else
|
|
||||||
"dev"
|
|
||||||
end
|
|
||||||
|
|
||||||
password =
|
|
||||||
if Mix.env() == :prod do
|
|
||||||
System.fetch_env!("BA_PASSWORD")
|
|
||||||
else
|
|
||||||
"dev"
|
|
||||||
end
|
|
||||||
|
|
||||||
Plug.BasicAuth.basic_auth(conn, username: username, password: password)
|
Plug.BasicAuth.basic_auth(conn, username: username, password: password)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user