Skip to main content

Limits

Technical limits for EdgeBase Authentication.

Tokens & Sessions

LimitDefaultConfigurableNotes
Access token TTL15 minutesYesauth.session.accessTokenTTL
Refresh token TTL28 daysYesauth.session.refreshTokenTTL
Max active sessions per userUnlimited (0)Yesauth.session.maxActiveSessions — see Session Management
Refresh token rotation grace period30 secondsNoPrevents race conditions in multi-tab scenarios
SDK proactive refresh buffer30 secondsNoRefreshes token 30s before expiry

Email Tokens

Token TypeTTLNotes
Email verification24 hourscrypto.randomUUID() generated
Password reset1 hour
Magic link15 minutesConfigurable via auth.magicLink.tokenTTL
MFA ticket5 minutesStored in KV with TTL

Phone / OTP

LimitValueNotes
OTP code length6 digits
OTP TTL5 minutes
Max OTP attempts5 per codeExceeding locks the code
OTP rate limit5 OTPs / hour per phone number
Phone formatE.164^\+[1-9]\d{6,14}$

Password

LimitDefaultConfigurableNotes
Minimum length8 charactersYesVia password policy config
HIBP check timeout3,000 msNoFail-open if API unavailable

See Password Policy for full configuration options including uppercase, lowercase, digit, special character, and leaked password requirements.

Infrastructure

LimitValueNotes
D1 read limit25B rows / monthAUTH_DB (all auth data) (Workers Paid)
D1 write limit50M rows / monthAUTH_DB (all auth data) (Workers Paid)
D1 storage10 GB / databaseAUTH_DB (all auth data) (Workers Paid)
Anonymous account retention30 daysConfigurable via auth.anonymousRetentionDays
Session cleanup intervalDaily at 03:00 UTCCron Trigger-based

Rate Limiting

GroupDefaultKeyConfigurable
auth30 req / 60sIPYes
authSignin10 req / 60semailYes
authSignup10 req / 60sIPYes

OAuth Providers

ProviderAuto-Link (email_verified)Notes
GoogleYesAlways verified
GitHubConditionalUnverified emails possible
AppleYesAlways verified
DiscordConditionalUses verified field
MicrosoftConditionalOrg accounts always verified
FacebookNoNo email_verified field
KakaoConditionalBusiness app config required
NaverNoAPI does not guarantee
X (Twitter)NoNot provided
LineNoNot provided
SlackYesEmail verification required at signup
SpotifyNoNot provided
TwitchConditionalUnverified emails possible
Self-hosting

D1 limits apply only to Cloudflare edge deployments. Docker and Node.js modes use local SQLite with no limits.

Scaling beyond D1

If your platform approaches D1 limits, the auth provider can be migrated to Neon PostgreSQL with a single config change (provider: 'neon'). This removes all D1 storage and throughput limits — governed only by your Neon plan. No SDK or application code changes required.