debianize-mobilizon/lib/eventos_web/auth_error_handler.ex
Thomas Citharel 1217361b6c fix some code style and add checks to ci
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2018-01-14 17:57:25 +01:00

12 lines
262 B
Elixir

defmodule EventosWeb.AuthErrorHandler do
@moduledoc """
In case we have an auth error
"""
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