View Source AshAuthentication.Plug.Defaults (ash_authentication v4.3.2)

Provides the default implementations of handle_success/3 and handle_failure/2 used in generated authentication plugs.

Summary

Functions

The default implementation of handle_failure/1.

The default implementation of handle_success/3.

Functions

Link to this function

handle_failure(conn, _, _)

View Source
@spec handle_failure(Plug.Conn.t(), {atom(), atom()}, any()) :: Plug.Conn.t()

The default implementation of handle_failure/1.

Sends a very basic 401 response.

Link to this function

handle_success(conn, activity, user, token)

View Source
@spec handle_success(
  Plug.Conn.t(),
  {atom(), atom()},
  Ash.Resource.record() | nil,
  String.t() | nil
) ::
  Plug.Conn.t()

The default implementation of handle_success/3.

Calls AshAuthentication.Plug.Helpers.store_in_session/2 then sends a basic 200 response.