Skip to content

Instantly share code, notes, and snippets.

@motephyr
Created November 7, 2017 09:41
Show Gist options
  • Save motephyr/3e32513549f586042ec9ae2cb75e2c98 to your computer and use it in GitHub Desktop.
Save motephyr/3e32513549f586042ec9ae2cb75e2c98 to your computer and use it in GitHub Desktop.
Guardian router pipline
...
pipeline :api do
plug :accepts, ["json"]
plug Guardian.Plug.Pipeline, module: GuardianSimpleAuth.Guardian, error_handler: GuardianSimpleAuth.ErrorHandler
plug Guardian.Plug.VerifySession, claims: %{"typ" => "access"}
plug Guardian.Plug.VerifyHeader, claims: %{"typ" => "access"}
plug Guardian.Plug.LoadResource, allow_blank: true
end
pipeline :auth do
plug Guardian.Plug.EnsureAuthenticated
end
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment