AshAuthentication.AddOn.Confirmation.Actions (ash_authentication v4.14.1)

View Source

Actions for the confirmation add-on.

Provides the code interface for working with resources via confirmation.

Summary

Functions

Attempt to confirm a user.

Get changes from the tokens resource for application.

Get a stored OAuth2/OIDC identity link for application when confirming.

Store changes in the tokens resource for later re-use.

Store an OAuth2/OIDC identity link to be applied when the token is confirmed.

Functions

confirm(strategy, params, opts \\ [])

@spec confirm(AshAuthentication.AddOn.Confirmation.t(), map(), keyword()) ::
  {:ok, Ash.Resource.record()} | {:error, any()}

Attempt to confirm a user.

get_changes(strategy, jti, opts \\ [])

@spec get_changes(AshAuthentication.AddOn.Confirmation.t(), String.t(), keyword()) ::
  {:ok, map()} | :error

Get changes from the tokens resource for application.

get_identity_link(strategy, jti, opts \\ [])

@spec get_identity_link(
  AshAuthentication.AddOn.Confirmation.t(),
  String.t(),
  keyword()
) ::
  {:ok, map()} | :error

Get a stored OAuth2/OIDC identity link for application when confirming.

store_changes(strategy, token, changeset, opts \\ [])

@spec store_changes(
  AshAuthentication.AddOn.Confirmation.t(),
  String.t(),
  Ash.Changeset.t(),
  keyword()
) ::
  :ok | {:error, any()}

Store changes in the tokens resource for later re-use.

store_identity_link(strategy, token, payload, opts \\ [])

@spec store_identity_link(
  AshAuthentication.AddOn.Confirmation.t(),
  String.t(),
  map(),
  keyword()
) ::
  :ok | {:error, any()}

Store an OAuth2/OIDC identity link to be applied when the token is confirmed.

Used by on_untrusted_email_match :confirm: payload (the provider strategy name, user_info and oauth_tokens) is stashed in the token's server-side extra_data so that confirming the token links the provider to the account.