mirror of
https://github.com/team-alembic/ash_authentication_phoenix.git
synced 2024-09-20 05:23:55 +12:00
7f792990f0
Allows the sign in, register and reset forms to be customised by way of a named slot.
37 lines
942 B
Elixir
37 lines
942 B
Elixir
defmodule DevWeb.Router do
|
|
@moduledoc false
|
|
|
|
use DevWeb, :router
|
|
use AshAuthentication.Phoenix.Router, otp_app: :ash_authentication_phoenix
|
|
|
|
pipeline :browser do
|
|
plug :accepts, ["html"]
|
|
plug :fetch_session
|
|
plug :fetch_live_flash
|
|
plug :put_root_layout, {DevWeb.LayoutView, :root}
|
|
plug :protect_from_forgery
|
|
plug :put_secure_browser_headers
|
|
plug :load_from_session
|
|
end
|
|
|
|
pipeline :api do
|
|
plug :accepts, ["json"]
|
|
end
|
|
|
|
scope "/", DevWeb do
|
|
pipe_through(:browser)
|
|
|
|
ash_authentication_live_session do
|
|
live "/", HomePageLive
|
|
live "/custom-sign-in", CustomSignInLive
|
|
end
|
|
end
|
|
|
|
scope "/", DevWeb do
|
|
pipe_through :browser
|
|
auth_routes_for(Example.Accounts.User, to: AuthController, path: "/auth")
|
|
sign_in_route(overrides: [DevWeb.AuthOverrides, AshAuthentication.Phoenix.Overrides.Default])
|
|
sign_out_route(AuthController, "/sign-out")
|
|
reset_route()
|
|
end
|
|
end
|