Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Hardens CorvEd’s authentication launch flows by adding client-side attempt cooldowns (as a UX/abuse-speedbump) with non-enumerating error messaging, and by tightening the post-auth profile completion gate so incomplete Google OAuth profiles must complete required business fields before reaching the dashboard.
Changes:
- Added
lib/auth/throttle.tsto implement browser-side cooldown tracking and a helper for mapping provider errors to generic, non-enumerating messages. - Updated sign-in/sign-up/tutor sign-up/forgot-password pages to apply cooldown checks and show friendly generic errors.
- Strengthened
/auth/callbackprofile gating viarequiresProfileSetup()(WhatsApp number + timezone) and updated docs/README accordingly.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/auth/utils.ts | Adds requiresProfileSetup() helper to centralize profile-completeness checks. |
| lib/auth/throttle.ts | Introduces localStorage-backed per-action cooldowns + generic auth error mapping. |
| lib/tests/auth-utils.test.ts | Adds unit coverage for requiresProfileSetup(). |
| lib/tests/auth-throttle.test.ts | Adds unit coverage for cooldown behavior and error-message mapping. |
| app/auth/sign-up/tutor/page.tsx | Applies signup cooldown + generic error handling to tutor signup. |
| app/auth/sign-up/page.tsx | Applies signup + Google OAuth cooldowns and generic error handling. |
| app/auth/sign-in/SignInForm.tsx | Applies sign-in + Google OAuth cooldowns; clears sign-in cooldown on success; generic error mapping. |
| app/auth/forgot-password/page.tsx | Applies password-reset cooldown + generic error handling. |
| app/auth/callback/route.ts | Extends profile gate to require both WhatsApp number and timezone before dashboard access. |
| docs/plan-CorvEd.md | Updates plan/checklist notes to reflect resolved OAuth profile setup and new throttling. |
| docs/GAP_ANALYSIS.md | Documents launch auth protections (Supabase rate limits + app-side cooldowns) and non-enumerating errors. |
| docs/ARCHITECTURE.md | Updates rate-limiting section with current protections and production-scale recommendations. |
| README.md | Updates auth feature checklist + adds Supabase Auth rate-limit/SMTP launch notes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/auth/profile-setupbefore dashboard access.Verification
Notes
Closes #136
Closes #137