Skip to content

feat!: update module to be compatible with saucebase 2.0 - #40

Merged
roble merged 14 commits into
mainfrom
dev-v2
Jun 3, 2026
Merged

feat!: update module to be compatible with saucebase 2.0#40
roble merged 14 commits into
mainfrom
dev-v2

Conversation

@roble

@roble roble commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

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:

  • Removed the obsolete app/Providers/RouteServiceProvider.php and switched the PSR-4 autoload path in composer.json from app/ to src/, aligning with Laravel package conventions. The module provider is now registered via composer.json instead of module.json, which was deleted. [1] [2] [3]
  • Added metadata to composer.json (description, license, version, minimum stability) and moved the provider registration to the extra.laravel.providers section. [1] [2]

Frontend Dual-Framework Support:

  • Documented and enforced a dual-framework pattern for the frontend (Vue and React), requiring mirrored implementations in resources/js/vue/ and resources/js/react/. The root resources/js/app.ts now simply re-exports the Vue entry point, and a new resources/js/react/app.tsx provides React setup logic. [1] [2] [3]
  • Added React implementations for ImpersonationAlert and SocialiteProviders components, matching their Vue counterparts. [1] [2]

Testing and Task Automation Updates:

  • Standardized the module name to lowercase (auth) in all test and automation scripts for consistency. Updated references in GitHub Actions workflows and the Taskfile.yml. [1] [2] [3] [4]
  • Added a new database seeder task and the corresponding seeder class for the Auth module. [1] [2]

Removed Legacy and Redundant Files:

  • Deleted module.json in favor of using composer.json for all module metadata and configuration.

These changes modernize the Auth module's structure, improve maintainability, and ensure parity between Vue and React implementations.

roble added 12 commits April 25, 2026 21:58
…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
Copilot AI review requested due to automatic review settings June 3, 2026 18:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 to src/, register provider in composer.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 thread database/seeders/DatabaseSeeder.php
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} />
Comment thread resources/js/react/layouts/AuthCardLayout.tsx Outdated
Comment thread vite.config.js
roble and others added 2 commits June 3, 2026 21:35
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>
@roble
roble merged commit 67459cb into main Jun 3, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants