Summary
- Add a persisted
email_verification_sent_at timestamp on users to track verification email sends.
- Throttle repeated verification email sends for five minutes in the onboarding resend endpoint, using an atomic update guard so concurrent requests cannot mint/send multiple tokens.
- Apply the same cooldown to profile email changes that generate verification tokens, and clear the throttle timestamp when an email is removed.
- Add unit coverage for first send, recent-send blocking, and resend after the cooldown.
Test plan
git diff --check
cargo test -p api onboarding::tests::email_verification_throttle -- --nocapture
cargo test -p api
cargo clippy -p api --all-targets (passes; existing warnings remain)
cargo test --workspace
Closes #334
## Summary
- Add a persisted `email_verification_sent_at` timestamp on users to track verification email sends.
- Throttle repeated verification email sends for five minutes in the onboarding resend endpoint, using an atomic update guard so concurrent requests cannot mint/send multiple tokens.
- Apply the same cooldown to profile email changes that generate verification tokens, and clear the throttle timestamp when an email is removed.
- Add unit coverage for first send, recent-send blocking, and resend after the cooldown.
## Test plan
- `git diff --check`
- `cargo test -p api onboarding::tests::email_verification_throttle -- --nocapture`
- `cargo test -p api`
- `cargo clippy -p api --all-targets` (passes; existing warnings remain)
- `cargo test --workspace`
Closes #334