1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Plugs.BasicAuthDecoderPlug do
12 def call(conn, _opts) do
13 with ["Basic " <> header] <- get_req_header(conn, "authorization"),
14 {:ok, userinfo} <- Base.decode64(header),
15 [username, password] <- String.split(userinfo, ":", parts: 2) do
17 |> assign(:auth_credentials, %{