feat(auth): add registration toggle and handle registration logic in … - #53
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (20)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe PR adds a persisted ChangesRegistration Control
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The toggle consistently controls new password and social account creation while preserving authentication for existing users, and no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Visitor
participant RegistrationMiddleware
participant SocialiteController
participant SocialiteService
Visitor->>RegistrationMiddleware: Request registration route
RegistrationMiddleware-->>Visitor: Return 404 when registration is disabled
Visitor->>SocialiteController: Submit social callback
SocialiteController->>SocialiteService: handleCallback(provider)
SocialiteService-->>SocialiteController: Reject new account
SocialiteController-->>Visitor: Show error toast and redirect to login
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 9.52% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 21 functions across 18 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This pull request introduces a comprehensive "registration enabled" feature toggle for user sign-up, affecting both standard and social authentication flows. The toggle allows administrators to control whether new users can register via the sign-up page or social login, with appropriate UI, backend, and settings changes. It also includes localization, middleware enforcement, exception handling, and thorough test coverage.
Registration Toggle Feature
registration_enabledsetting toAuthSettings, with a migration to default it to true, and exposed it to the frontend via Inertia. [1] [2] [3]EnsureRegistrationEnabledmiddleware to block register routes with a 404 when registration is disabled, and applied it inroutes/web.php. [1] [2] [3]Social Authentication Integration
SocialiteServiceto throw a specific exception if registration is disabled and a new user tries to sign in with a social provider; updated controller to handle this gracefully. [1] [2] [3]Localization and Messaging
Testing
Summary by CodeRabbit
New Features
Bug Fixes