feat(auth): add support for enabling/disabling socialite providers - #52
Conversation
- Introduced migration to add `enabled_socialite_providers` to auth settings. - Updated SocialiteProviders component in React and Vue to utilize dynamic provider data. - Enhanced AuthSettings page to allow admin configuration of enabled social providers. - Implemented middleware to ensure only enabled providers can be accessed. - Updated SocialiteService to filter enabled providers and validate their availability. - Added tests for socialite provider functionality, including enabling/disabling providers and ensuring proper behavior in login flows.
|
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 ignored due to path filters (1)
📒 Files selected for processing (19)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe pull request adds configurable Socialite providers. Authentication settings persist enabled providers, backend services filter and validate them, OAuth routes enforce availability, and React/Vue components render the shared provider configuration. ChangesSocialite provider configuration
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to This change adds configurable social login providers and protects disabled or unknown provider routes; no actionable merge-blocking risk remains beyond normal checks and review. Sequence Diagram(s)sequenceDiagram
participant Admin
participant AuthenticationSettings
participant AuthSettings
participant SocialiteService
participant LoginPage
participant OAuthRoute
participant EnsureSocialiteProviderEnabled
Admin->>AuthenticationSettings: Save enabled providers
AuthenticationSettings->>AuthSettings: Persist provider names
LoginPage->>SocialiteService: Request enabled providers
SocialiteService->>AuthSettings: Read provider settings
SocialiteService-->>LoginPage: Return provider names and labels
LoginPage->>OAuthRoute: Start provider authentication
OAuthRoute->>EnsureSocialiteProviderEnabled: Check route provider
EnsureSocialiteProviderEnabled->>SocialiteService: Validate provider is enabled
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 20.93% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 43 functions across 17 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 system for configuring which social login providers ("Socialite providers") are available to users through the admin interface. It ensures that only enabled providers are shown on the login page and that authentication routes are protected from disabled or unknown providers. The implementation includes backend settings, middleware enforcement, UI updates, and thorough testing.
Administrative control over social login providers:
enabled_socialite_providerssetting toAuthSettings, with a migration and admin UI allowing selection of which providers are enabled. [1] [2] [3] [4]SocialiteServiceto provide only enabled providers and to validate provider availability, including methods for checking and listing enabled providers.Middleware and route protection:
EnsureSocialiteProviderEnabledmiddleware to block access to socialite routes for disabled or unknown providers, returning a 404 error if accessed. This middleware is applied to relevant routes. [1] [2] [3]Frontend and user experience:
Inertia data sharing:
Testing and validation:
Summary by CodeRabbit
New Features
Bug Fixes