+ defp valid_field?(_), do: false
+
+ @spec confirmation_changeset(Info.t(), keyword()) :: Changeset.t()
+ def confirmation_changeset(info, opts) do
+ need_confirmation? = Keyword.get(opts, :need_confirmation)
+
+ params =
+ if need_confirmation? do
+ %{
+ confirmation_pending: true,
+ confirmation_token: :crypto.strong_rand_bytes(32) |> Base.url_encode64()
+ }
+ else
+ %{
+ confirmation_pending: false,
+ confirmation_token: nil
+ }
+ end
+