Pow v1.0.16 Pow.Phoenix.Routes behaviour View Source
Module that handles routes.
Usage
defmodule MyAppWeb.Pow.Routes do
use Pow.Phoenix.Routes
alias MyAppWeb.Router.Helpers, as: Routes
@impl true
def after_sign_out_path(conn), do: Routes.some_path(conn, :index)
end
Update configuration with routes_backend: MyAppWeb.Pow.Routes
.
You can also customize path generation:
defmodule MyAppWeb.Pow.Routes do
use Pow.Phoenix.Routes
alias MyAppWeb.Router.Helpers, as: Routes
@impl true
def url_for(conn, verb, vars \ [], query_params \ [])
def url_for(conn, PowEmailConfirmation.Phoenix.ConfirmationController, :show, [token], _query_params),
do: Routes.custom_confirmation_url(conn, :new, token)
def url_for(conn, plug, verb, vars, query_params),
do: Pow.Phoenix.Routes.url_for(conn, plug, verb, vars, query_params)
end
Link to this section Summary
Functions
Path to redirect user to when user has signed up.
Path to redirect user to when user has signed in.
Path to redirect user to when user has signed out.
Path to redirect user to when user has deleted their account.
Path to redirect user to when user has updated their account.
Generates a path route.
Generates a url route.
Path to redirect user to when user has already been authenticated.
Path to redirect user to when user is not authenticated.
Link to this section Functions
Path to redirect user to when user has signed up.
By default this is the same as after_sign_in_path/1
.
Path to redirect user to when user has signed in.
This will look for a :request_path
assigns key, and redirect to this value
if it exists.
Path to redirect user to when user has signed out.
Path to redirect user to when user has deleted their account.
By default this is the same as after_sign_out_path/1
.
Path to redirect user to when user has updated their account.
Generates a path route.
Generates a url route.
Path to redirect user to when user has already been authenticated.
By default this is the same as after_sign_in_path/1
.
Path to redirect user to when user is not authenticated.
This will put a :request_path
param into the path that can be used to
redirect users back the the page they first attempted to visit. See
after_sign_in_path/1
for how :request_path
is handled.
The :request_path
will only be added if the request uses "GET" method.
See Pow.Phoenix.SessionController
for more on how this value is handled.
Link to this section Callbacks
after_registration_path(arg1)
View Sourceafter_registration_path(Plug.Conn.t()) :: binary()
after_sign_in_path(arg1)
View Sourceafter_sign_in_path(Plug.Conn.t()) :: binary()
after_sign_out_path(arg1)
View Sourceafter_sign_out_path(Plug.Conn.t()) :: binary()
after_user_deleted_path(arg1)
View Sourceafter_user_deleted_path(Plug.Conn.t()) :: binary()
after_user_updated_path(arg1)
View Sourceafter_user_updated_path(Plug.Conn.t()) :: binary()
registration_path(arg1, atom)
View Sourceregistration_path(Plug.Conn.t(), atom()) :: binary()
session_path(arg1, atom, list)
View Sourcesession_path(Plug.Conn.t(), atom(), list()) :: binary()
user_already_authenticated_path(arg1)
View Sourceuser_already_authenticated_path(Plug.Conn.t()) :: binary()
user_not_authenticated_path(arg1)
View Sourceuser_not_authenticated_path(Plug.Conn.t()) :: binary()