Skip to content

digital-identity-platform-docs


digital-identity-platform-docs / supabase/functions/check-email-exists

supabase/functions/check-email-exists

Fileoverview

Check Email Exists Edge Function

Checks if an email address is already registered in the system. Used during invitation flow to determine if invitee needs to register.

Cloudflare Architecture Context

AttributeValue
Classification🔵 BACKEND-ONLY
PositionApp Backend (invitation flow)
Receives Public TrafficYes (unauthenticated check)
Latency SensitiveNo
Safe to RetryYes (read-only)
Failure BehaviorFail-closed (returns error)

Endpoint

POST /check-email-exists

Auth

None - Public endpoint (verify_jwt = false in config)

Remarks

  • Uses Admin API to search auth.users table
  • Performs case-insensitive email matching
  • Paginates through users to find exact match
  • Has safety limit of 50 pages (2500 users) to prevent excessive API calls

Tables touched:

  • auth.users (read via Admin API)

Example

json
{ "email": "user@example.com" }

Type Aliases

Released under proprietary license.