Skip to content

fix(auth): allow two email codes per address per minute - #3553

Merged
bobleer merged 1 commit into
GCWing:mainfrom
bobleer:bob/auth-email-two-per-minute
Oct 26, 2026
Merged

bobleer merged 1 commit into
GCWing:mainfrom
bobleer:bob/auth-email-two-per-minute

Conversation

@bobleer

@bobleer bobleer commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Allow two verification emails per address in a rolling 60-second window. A user can request a code on their phone and then immediately request another on desktop; a third request within the window still returns email_rate_limit.

Type and Areas

Type: bug fix

Areas: shared identity service, email authentication, service documentation

Motivation / Impact

The previous one-code-per-minute quota was shared across devices and remained charged after successful sign-in. Signing in on a phone could therefore block the following desktop sign-in until the minute elapsed.

The atomic database admission now permits two sends per address per rolling minute. The rolling 24-hour address limit of 20, global limit of 300 sends per minute, code expiration and verification-attempt limits remain unchanged. Tests cover concurrent requests, rolling-window recovery, persistence across service reopen, immediate sign-in through a second flow, and the existing daily/global limits.

Verification

  • pnpm run fmt:rs and git diff --check passed.
  • cargo test --locked -p openbitfun-miniapp-market-service --lib email_auth::tests passed: 16 tests.
  • cargo check --locked -p openbitfun-miniapp-market-server passed.
  • The same changes also passed the 16 email-auth tests against the current main checkout.
  • Production image built successfully from commit 8777e9a022d9770d5b501bf979f705e7ffcb55b4; deployed container reports that revision and is healthy. Public health, auth configuration and sign-in page checks passed.
  • Remote coverage: shared server authentication was exercised with distinct login flows in service tests. Physical mobile/desktop remote-control sign-in, remote workspace, Peer Device Mode and Detached Dispatch were not exercised end to end.

Reviewer Notes

No schema, payload or client protocol changes. Existing persisted send records continue to count toward the quota. The fix is already deployed; this PR records it in main for subsequent releases.

AI-assisted implementation. Testing level: service regression tests and production deployment smoke checks; physical device end-to-end testing was not performed.

Checklist

  • This PR is focused and does not include secrets, temporary prompts, generated scratch files, or unrelated artifacts.
  • Relevant verification is recorded above, or skipped checks are explained.
  • User-facing strings, docs, and locales are updated where applicable.

@bobleer
bobleer merged commit 2d06a77 into GCWing:main Oct 26, 2026
13 checks passed
@bobleer
bobleer deleted the bob/auth-email-two-per-minute branch October 27, 2026 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant