Supabase. Auth. Passkey. Behaviour behaviour
(supabase_auth v1.1.0)
View Source
Behaviour and type definitions for passkey (first-factor WebAuthn) operations.
The WebAuthn ceremony itself (navigator.credentials.create/get) runs in
the browser; these callbacks cover the HTTP half: fetching challenge
options and verifying the resulting credential. See the passkey guide
(pages/passkey_guide.md) for wiring the ceremony via LiveView + JS hooks.
Summary
Types
Callbacks
@callback delete(Supabase.Client.t(), Supabase.Auth.Session.t(), String.t()) :: :ok | {:error, term()}
@callback list(Supabase.Client.t(), Supabase.Auth.Session.t()) :: {:ok, [passkey()]} | {:error, term()}
@callback start_authentication(Supabase.Client.t(), map()) :: {:ok, request_options()} | {:error, term()}
@callback start_registration(Supabase.Client.t(), Supabase.Auth.Session.t()) :: {:ok, creation_options()} | {:error, term()}
@callback update(Supabase.Client.t(), Supabase.Auth.Session.t(), String.t(), String.t()) :: {:ok, passkey()} | {:error, term()}
@callback verify_authentication(Supabase.Client.t(), String.t(), credential()) :: {:ok, Supabase.Auth.Session.t()} | {:error, term()}
@callback verify_registration( Supabase.Client.t(), Supabase.Auth.Session.t(), String.t(), credential() ) :: {:ok, passkey()} | {:error, term()}