Packages

Integration with the Auth API from Supabase services. Provide authentication with MFA, password and magic link.

Current section

Files

Jump to
supabase_auth lib supabase auth schemas mfa challenge_and_verify_params.ex
Raw

lib/supabase/auth/schemas/mfa/challenge_and_verify_params.ex

defmodule Supabase.Auth.Schemas.MFA.ChallengeAndVerifyParams do
@moduledoc false
use Ecto.Schema
import Ecto.Changeset
@type t :: %{code: String.t()}
@types %{code: :string}
@spec parse(map()) :: {:ok, t()} | {:error, Ecto.Changeset.t()}
def parse(%{code: _} = attrs) do
{%{}, @types}
|> cast(attrs, [:code])
|> validate_required([:code])
|> validate_length(:code, is: 6)
|> apply_action(:parse)
end
end