Protect endpoints

This commit is contained in:
2023-02-18 11:17:08 +00:00
parent ff8a0e6260
commit a61c14893f
4 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
defmodule PhoenixApiTemplateWeb.Auth.Pipeline do
use Guardian.Plug.Pipeline,
otp_app: :phoenix_api_template,
module: PhoenixApiTemplateWeb.Auth.Guardian,
error_handler: PhoenixApiTemplateWeb.Auth.GuardianErrorHandler
plug Guardian.Plug.VerifySession
plug Guardian.Plug.VerifyHeader
plug Guardian.Plug.EnsureAuthenticated
plug Guardian.Plug.LoadResource
end