View Source AshAuthentication.Phoenix.Plug (ash_authentication_phoenix v1.9.4)

Helper plugs mixed in to your router.

When you use AshAuthentication.Phoenix.Router this module is included, so that you can use these plugs in your pipelines.

Summary

Functions

Attempt to retrieve actors from the Authorization header(s).

Attempt to retrieve all actors from the connections' session.

Revoke all token(s) in the Authorization header(s).

Store the actor in the connections' session.

Functions

Link to this function

load_from_bearer(conn, opts)

View Source
@spec load_from_bearer(Plug.Conn.t(), any()) :: Plug.Conn.t()

Attempt to retrieve actors from the Authorization header(s).

A wrapper around AshAuthentication.Plug.Helpers.retrieve_from_bearer/2 with the otp_app as extracted from the endpoint.

Link to this function

load_from_session(conn, opts)

View Source
@spec load_from_session(Plug.Conn.t(), any()) :: Plug.Conn.t()

Attempt to retrieve all actors from the connections' session.

A wrapper around AshAuthentication.Plug.Helpers.retrieve_from_session/2 with the otp_app as extracted from the endpoint.

Link to this function

revoke_bearer_tokens(conn, opts)

View Source
@spec revoke_bearer_tokens(Plug.Conn.t(), any()) :: Plug.Conn.t()

Revoke all token(s) in the Authorization header(s).

A wrapper around AshAuthentication.Plug.Helpers.revoke_bearer_tokens/2 with the otp_app as extracted from the endpoint.

Link to this function

store_in_session(conn, actor)

View Source
@spec store_in_session(Plug.Conn.t(), Ash.Resource.record()) :: Plug.Conn.t()

Store the actor in the connections' session.