TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/exegia/corpora-py/llms.txt
Use this file to discover all available pages before exploring further.
exegia.auth.signin module provides three functions covering the two main sign-in paths: email OTP (two-step) and OIDC ID token (one-step). After the provider authenticates the user, both paths run a public.users lookup and return a SignInResult — either a full authenticated payload or a needs_signup signal if no application profile exists yet.
Email OTP Flow
The email OTP flow is two steps: first dispatch the code, then verify it. No session is created until the second step.Send the one-time code
Call
request_email_otp with the user’s email address. This triggers a magic-link email via Supabase Auth. No session or profile check happens at this stage.OIDC ID Token Flow
The Apple and Google flows are single-step. The client obtains an ID token directly from the provider and exchanges it for a Supabase session in one call.SignInResult Fields
True when the user is authenticated and has a public.users record. This is the only fully successful state.The combined auth identity and application profile. Set only when
ok is True. Contains id, email, is_anonymous, is_permanent, has_profile, and providers.The Supabase session (access and refresh tokens). Present both on success and on the
needs_signup path, so the caller can pass session.access_token to sign_up() without re-authenticating.A user-facing message. Set on all non-
ok paths, including needs_signup.True when the provider authenticated the user but no public.users record was found. Defaults to False. Offer registration rather than a sign-in error.Function Reference
request_email_otp
Destination email address to send the OTP or magic link to.
URL to redirect the user to after they click the magic link. Optional.
Whether to create a new
auth.users record when the email is not yet registered. Defaults to the project setting when omitted. Optional.CAPTCHA verification token. Required when CAPTCHA protection is enabled on the Supabase project. Optional.
verify_email_otp
The email address the OTP was sent to. Must match the address used in
request_email_otp.The 6-digit one-time code the user received by email.
CAPTCHA verification token. Optional.
sign_in_with_id_token
The OIDC provider that issued the token.
IdTokenProvider is a Literal["apple", "google"] type from exegia.supabase.authentication. GitHub is not supported via this flow — use the OAuth identity-linking flow for GitHub instead.The OIDC ID token (JWT) returned by the provider’s native sign-in SDK.
Optional provider access token. Some providers require this to fetch additional profile details. Optional.
The raw nonce used when requesting the ID token from the provider. Apple sign-in typically requires this to be supplied. Optional.
CAPTCHA verification token. Optional.
Error Handling
Bothverify_email_otp and sign_in_with_id_token raise AuthApiError (from supabase_auth) when the provider rejects the request — for example, when a code has expired or a token is malformed. Catch this at the call site to surface a clean error to the user.
If
result.needs_signup is True, the user authenticated successfully but has no public.users record. The session is still available on result.session. Pass result.session.access_token to sign_up() to complete registration without requiring the user to sign in again.