Packages

This library is a summary of the functions that are generally required for Web service development.

Current section

Files

Jump to
servicex lib servicex authenticator authenticate_error_handler.ex
Raw

lib/servicex/authenticator/authenticate_error_handler.ex

defmodule Servicex.AuthenticateErrorHandler do
@moduledoc false
import Plug.Conn
def auth_error(conn, {type, reason}, _opts) do
body = Poison.encode!(%{message: to_string(type)})
send_resp(conn, 401, body)
end
end