Conversation
…ration, password reset, and social login - Add LoginController for handling user login and session management. - Introduce MagicLinkController for magic link authentication. - Create PasswordController for updating user passwords. - Implement RegisterController for user registration and role assignment. - Add ReimpersonateController for re-impersonating users. - Create ResetPasswordController for handling password reset requests. - Implement SocialiteController for social authentication and account linking. - Add VerifyEmailController for email verification. - Create middleware to ensure magic link functionality is enabled. - Implement LoginRequest and RegisterRequest for request validation. - Add listeners for user registration, impersonation events, and last login updates. - Create models for MagicLinkToken and SocialAccount to manage tokens and social accounts. - Implement notifications for magic link and welcome messages. - Register AuthServiceProvider to share authentication data with Inertia. - Create SocialiteService for handling social authentication logic. - Add Sociable trait to manage user social accounts.
Implement comprehensive authentication features and improvements
…ng login, registration, password reset, and email verification
Restructure authentication module for Vue and React frameworks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modernizes the Auth module for Saucebase 2.0 by migrating the module to Laravel package-style structure (src/ autoload + provider registration via composer.json), expanding backend auth features (Socialite, magic link, impersonation, Filament user admin), and enforcing dual-framework (Vue + React) frontend parity.
Changes:
- Restructure module metadata/registration (remove
module.json, PSR-4 tosrc/, register provider incomposer.json, update workflows/tasks). - Add/organize backend auth capabilities (Socialite service + models/traits, magic link models/notifications, impersonation + listeners, request validation).
- Add React counterparts for Auth frontend pages/components while keeping Vue implementations.
Reviewed changes
Copilot reviewed 35 out of 69 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| vite.config.js | Replace prior module asset path export with an empty default export. |
| Taskfile.yml | Standardize module naming and add a DB seeding task. |
| src/Traits/Sociable.php | Add User trait for social accounts relationship + helpers. |
| src/Services/SocialiteService.php | Centralize Socialite OAuth logic (callback/link/disconnect). |
| src/Providers/AuthServiceProvider.php | Update provider to new module conventions + config merge adjustment. |
| src/Notifications/WelcomeNotification.php | Add welcome email notification. |
| src/Notifications/MagicLinkNotification.php | Add magic link email notification. |
| src/Models/SocialAccount.php | Introduce social account persistence model. |
| src/Models/MagicLinkToken.php | Introduce magic link token persistence model. |
| src/Listeners/UpdateUserLastLogin.php | Update user last-login timestamp on Login event. |
| src/Listeners/SendWelcomeNotification.php | Send welcome email on Registered event. |
| src/Listeners/Impersonation.php | Track recent impersonation history and show toast on enter. |
| src/Listeners/AssignUserRole.php | Ensure a default user role is assigned on registration. |
| src/Http/Requests/RegisterRequest.php | Add registration validation + password hashing. |
| src/Http/Requests/LoginRequest.php | Add login validation + credential verification + throttling. |
| src/Http/Middleware/EnsureMagicLinkEnabled.php | Add middleware gate for magic-link feature. |
| src/Http/Controllers/VerifyEmailController.php | Add email verification callback controller. |
| src/Http/Controllers/SocialiteController.php | Update Socialite callback strings/namespacing and flows. |
| src/Http/Controllers/ResetPasswordController.php | Namespace password reset status/error translations. |
| src/Http/Controllers/ReimpersonateController.php | Add “re-impersonate from history” endpoint. |
| src/Http/Controllers/RegisterController.php | Update welcome translation key namespacing. |
| src/Http/Controllers/PasswordController.php | Add authenticated password update endpoint. |
| src/Http/Controllers/MagicLinkController.php | Namespace magic-link status/error translations. |
| src/Http/Controllers/LoginController.php | Update welcome-back translation key namespacing. |
| src/Http/Controllers/ForgotPasswordController.php | Namespace forgot-password status translations. |
| src/Http/Controllers/EmailVerificationPromptController.php | Add verification prompt page controller. |
| src/Http/Controllers/EmailVerificationNotificationController.php | Namespace verification notification status translation. |
| src/Http/Controllers/Controller.php | Add module-local base controller. |
| src/Filament/Resources/Users/UserResource.php | Add Filament user management resource. |
| src/Filament/Resources/Users/Tables/UsersTable.php | Add Filament users table configuration. |
| src/Filament/Resources/Users/Schemas/UserInfolist.php | Add Filament user infolist w/ social account management. |
| src/Filament/Resources/Users/Schemas/UserForm.php | Add Filament create/edit user form schema. |
| src/Filament/Resources/Users/Pages/ViewUser.php | Add Filament “view user” page. |
| src/Filament/Resources/Users/Pages/ListUsers.php | Add Filament “list users” page. |
| src/Filament/Resources/Users/Pages/EditUser.php | Add Filament “edit user” page. |
| src/Filament/Resources/Users/Pages/CreateUser.php | Add Filament “create user” page. |
| src/Filament/AuthPlugin.php | Add navigation group sort customization. |
| src/Exceptions/SocialiteException.php | Namespace Socialite exception translations. |
| src/Exceptions/AuthException.php | Namespace Auth exception translations. |
| routes/web.php | Re-group routes with explicit web middleware; reorganize auth/socialite/magic-link routes. |
| routes/api.php | Wrap API routes with explicit api middleware. |
| resources/js/vue/pages/VerifyEmail.vue | Add Vue Verify Email page. |
| resources/js/vue/pages/ResetPassword.vue | Add Vue Reset Password page. |
| resources/js/vue/pages/Register.vue | Add Vue Register page. |
| resources/js/vue/pages/MagicLink.vue | Add Vue Magic Link request page. |
| resources/js/vue/pages/Login.vue | Add Vue Login page. |
| resources/js/vue/pages/ForgotPassword.vue | Add Vue Forgot Password page. |
| resources/js/vue/layouts/AuthCardLayout.vue | Adjust layout sizing/padding for auth card pages. |
| resources/js/vue/components/SocialiteProviders.vue | Add Vue provider buttons component. |
| resources/js/vue/components/ImpersonationAlert.vue | Add Vue impersonation UI widget w/ recent history. |
| resources/js/vue/app.ts | Move Vue module bootstrap/setup to framework-specific entry. |
| resources/js/react/pages/VerifyEmail.tsx | Add React Verify Email page. |
| resources/js/react/pages/ResetPassword.tsx | Add React Reset Password page. |
| resources/js/react/pages/Register.tsx | Add React Register page. |
| resources/js/react/pages/MagicLink.tsx | Add React Magic Link request page. |
| resources/js/react/pages/Login.tsx | Add React Login page. |
| resources/js/react/pages/ForgotPassword.tsx | Add React Forgot Password page. |
| resources/js/react/layouts/AuthCardLayout.tsx | Add React Auth card layout wrapper. |
| resources/js/react/components/SocialiteProviders.tsx | Add React provider buttons component. |
| resources/js/react/components/ImpersonationAlert.tsx | Add React impersonation UI widget w/ recent history. |
| resources/js/react/app.tsx | Add React module bootstrap/setup entry. |
| resources/js/app.ts | Convert root app entry into a Vue re-export. |
| module.json | Remove legacy module metadata file. |
| database/seeders/DatabaseSeeder.php | Add module DatabaseSeeder that calls AuthDatabaseSeeder. |
| composer.json | Add package metadata + provider registration + PSR-4 move to src/. |
| CLAUDE.md | Document dual-framework requirements and update E2E project naming. |
| app/Providers/RouteServiceProvider.php | Remove module RouteServiceProvider (legacy module structure). |
| .github/workflows/test.yml | Standardize module name and run tests for Vue + React frameworks. |
| .github/workflows/release.yml | Switch semantic-release version source from module.json to composer.json. |
Comments suppressed due to low confidence (1)
src/Http/Controllers/SocialiteController.php:70
- The guest Socialite callback flow calls SocialiteService::handleCallback() without catching SocialiteException/driver errors. Since handleCallback() can throw (e.g., unsupported provider / invalid social user), this will result in a 500 instead of a user-facing error + redirect.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+33
to
+36
| return ( | ||
| <div className="flex h-screen flex-col items-center gap-6"> | ||
| <div className="mt-6"> | ||
| <Head title={title} /> |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
This pull request makes significant improvements to the Auth module by restructuring the codebase, enhancing frontend framework support, and updating configuration and workflow files for consistency and maintainability. The most important changes are summarized below.
Codebase Restructuring and Configuration:
app/Providers/RouteServiceProvider.phpand switched the PSR-4 autoload path incomposer.jsonfromapp/tosrc/, aligning with Laravel package conventions. The module provider is now registered viacomposer.jsoninstead ofmodule.json, which was deleted. [1] [2] [3]composer.json(description, license, version, minimum stability) and moved the provider registration to theextra.laravel.providerssection. [1] [2]Frontend Dual-Framework Support:
resources/js/vue/andresources/js/react/. The rootresources/js/app.tsnow simply re-exports the Vue entry point, and a newresources/js/react/app.tsxprovides React setup logic. [1] [2] [3]ImpersonationAlertandSocialiteProviderscomponents, matching their Vue counterparts. [1] [2]Testing and Task Automation Updates:
auth) in all test and automation scripts for consistency. Updated references in GitHub Actions workflows and theTaskfile.yml. [1] [2] [3] [4]Removed Legacy and Redundant Files:
module.jsonin favor of usingcomposer.jsonfor all module metadata and configuration.These changes modernize the Auth module's structure, improve maintainability, and ensure parity between Vue and React implementations.