Skip to content

Instantly share code, notes, and snippets.

defmodule Auth.Guardian.Pipeline do
@moduledoc """
Configures a set of plugs to be used with Guardian based authentication / authorisation
"""
use Guardian.Plug.Pipeline,
otp_app: :orders,
error_handler: Auth.Guardian.ErrorHandler,
module: Auth.Guardian
# Verify authorisation header and make sure order management is allowed for Identity
# Pipeline for private apis, requires Authorisation header with Bearer token
pipeline :private do
plug :accepts, ["json"]
plug Auth.Guardian.Pipeline
end