Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/web/basic_auth.ex b/web/basic_auth.ex
- index 474cdb7..001fc21 100644
- --- a/web/basic_auth.ex
- +++ b/web/basic_auth.ex
- @@ -5,9 +5,14 @@ defmodule BasicAuth do
- opts
- end
- - def call(conn, opts) do
- - conn
- - |> send_resp(401, "unauthorized")
- - |> halt()
- + def call(conn, [username: username, password: password]) do
- + case get_req_header(conn, "authorization") do
- + ["Basic " <> auth] ->
- + conn
- + _ ->
- + conn
- + |> send_resp(401, "unauthorized")
- + |> halt()
- + end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement