Pow v0.1.0-rc.1 Pow.Plug View Source
Authorization methods for Plug.
Link to this section Summary
Functions
Assign an authenticated user to the connection
Authenticates a user
Creates a changeset from the current authenticated user
Clears the user authentication from the session
Creates a new user
Get the current authenticated user
Deletes the current authenticated user
Fetch configuration from the private key in the connection
Put the provided config as a private key in the connection
Updates the current authenticated user
Link to this section Functions
assign_current_user(Plug.Conn.t(), any(), Pow.Config.t()) :: Plug.Conn.t()
Assign an authenticated user to the connection.
authenticate_user(Plug.Conn.t(), map()) :: {:ok | :error, Plug.Conn.t()} | no_return()
Authenticates a user.
If successful, a new session will be created.
change_user(Plug.Conn.t(), map()) :: map()
Creates a changeset from the current authenticated user.
clear_authenticated_user(Plug.Conn.t()) :: {:ok, Plug.Conn.t()} | no_return()
Clears the user authentication from the session.
create_user(Plug.Conn.t(), map()) :: {:ok, map(), Plug.Conn.t()} | {:error, map(), Plug.Conn.t()} | no_return()
Creates a new user.
If successful, a new session will be created.
current_user(Plug.Conn.t()) :: map() | nil | no_return()
current_user(Plug.Conn.t(), Pow.Config.t()) :: map() | nil
Get the current authenticated user.
delete_user(Plug.Conn.t()) :: {:ok, map(), Plug.Conn.t()} | {:error, map(), Plug.Conn.t()} | no_return()
Deletes the current authenticated user.
If successful, the user authentication will be cleared from the session.
fetch_config(Plug.Conn.t()) :: Pow.Config.t() | no_return()
Fetch configuration from the private key in the connection.
It’ll raise an error if configuration hasn’t been set as a private key.
put_config(Plug.Conn.t(), Pow.Config.t()) :: Plug.Conn.t()
Put the provided config as a private key in the connection.
update_user(Plug.Conn.t(), map()) :: {:ok, map(), Plug.Conn.t()} | {:error, map(), Plug.Conn.t()} | no_return()
Updates the current authenticated user.
If successful, a new session will be created.