diff --git a/lib/ash_authentication/add_ons/confirmation/transformer.ex b/lib/ash_authentication/add_ons/confirmation/transformer.ex index fe58465..f137234 100644 --- a/lib/ash_authentication/add_ons/confirmation/transformer.ex +++ b/lib/ash_authentication/add_ons/confirmation/transformer.ex @@ -189,19 +189,8 @@ defmodule AshAuthentication.AddOn.Confirmation.Transformer do with {:ok, resource} <- persisted_option(dsl_state, :module), {:ok, attribute} <- find_attribute(dsl_state, strategy.confirmed_at_field), :ok <- validate_attribute_option(attribute, resource, :writable?, [true]), - :ok <- validate_attribute_option(attribute, resource, :allow_nil?, [true]), - :ok <- validate_attribute_option(attribute, resource, :type, [Type.UtcDatetimeUsec]) do - :ok - else - :error -> - {:error, - DslError.exception( - path: [:confirmation], - message: "The `confirmed_at_field` option must be set." - )} - - {:error, reason} -> - {:error, reason} + :ok <- validate_attribute_option(attribute, resource, :allow_nil?, [true]) do + validate_attribute_option(attribute, resource, :type, [Type.UtcDatetimeUsec]) end end diff --git a/lib/ash_authentication/strategies/oauth2/identity_change.ex b/lib/ash_authentication/strategies/oauth2/identity_change.ex index 34959bc..a3e53e2 100644 --- a/lib/ash_authentication/strategies/oauth2/identity_change.ex +++ b/lib/ash_authentication/strategies/oauth2/identity_change.ex @@ -31,11 +31,9 @@ defmodule AshAuthentication.Strategy.OAuth2.IdentityChange do changeset |> Changeset.after_action(fn changeset, user -> with {:ok, user_id_attribute_name} <- - strategy.identity_resource - |> UserIdentity.Info.user_identity_user_id_attribute_name(), + UserIdentity.Info.user_identity_user_id_attribute_name(strategy.identity_resource), {:ok, _identity} <- - strategy.identity_resource - |> UserIdentity.Actions.upsert(%{ + UserIdentity.Actions.upsert(strategy.identity_resource, %{ user_info: Changeset.get_argument(changeset, :user_info), oauth_tokens: Changeset.get_argument(changeset, :oauth_tokens), strategy: Strategy.name(strategy), @@ -44,7 +42,6 @@ defmodule AshAuthentication.Strategy.OAuth2.IdentityChange do user |> Ash.load(strategy.identity_relationship_name, domain: Info.domain!(strategy.resource)) else - :error -> :error {:error, reason} -> {:error, reason} end end) diff --git a/lib/ash_authentication/strategies/oauth2/transformer.ex b/lib/ash_authentication/strategies/oauth2/transformer.ex index 640b371..6db1fd9 100644 --- a/lib/ash_authentication/strategies/oauth2/transformer.ex +++ b/lib/ash_authentication/strategies/oauth2/transformer.ex @@ -96,9 +96,6 @@ defmodule AshAuthentication.Strategy.OAuth2.Transformer do :ok <- maybe_validate_action_has_identity_change(action, strategy) do :ok else - :error -> - {:error, "Unable to validate register action"} - {:error, reason} when is_binary(reason) -> {:error, "`#{inspect(strategy.register_action_name)}` action: #{reason}"} @@ -139,7 +136,6 @@ defmodule AshAuthentication.Strategy.OAuth2.Transformer do :ok <- validate_action_has_preparation(action, OAuth2.SignInPreparation) do :ok else - :error -> {:error, "Unable to validate sign in action"} {:error, reason} -> {:error, reason} end end diff --git a/lib/ash_authentication/verifier.ex b/lib/ash_authentication/verifier.ex index 3efa8e5..7f04fd2 100644 --- a/lib/ash_authentication/verifier.ex +++ b/lib/ash_authentication/verifier.ex @@ -124,9 +124,6 @@ defmodule AshAuthentication.Verifier do {:ok, falsy} when is_falsy(falsy) -> :ok - {:error, reason} -> - {:error, reason} - {false, bad_token_resource} -> {:error, DslError.exception(