saucebase/auth
Authentication package for Laravel and the Saucebase stack, providing a simple, flexible way to add login, registration, password resets, and session or token-based auth to your applications. Integrates cleanly with Laravel's guards, user providers, and middleware.
Architecture fit. saucebase/auth is a drop-in auth module for the Saucebase modular Laravel starter, not a standalone package. It spans a full vertical slice: controllers, models (SocialAccount, MagicLinkToken), a SocialiteService, form requests with rate limiting and password hashing, domain exceptions, event listeners, notifications, middleware, a Sociable trait for User, Filament admin resources, and Inertia/Vue-or-React pages (Login, Register, MagicLink, SettingsProfile, SettingsSecurity). It assumes a host app that already provides: Saucebase core (settings modal shell, Home::url, Auth::SettingsProfile conventions, navigation registerIcon/registerAction helpers), Filament v3+ with stechstudio/filament-impersonate, Laravel Socialite, and either @saucebase/vue or @saucebase/react. The design is coherent and opinionated — settings are auto-discovered from src/Settings, defaults are seeded, routes deliberately preserve settings.* names for core route resolution — but the coupling means it is a "module for Saucebase," not a portable auth kit.
Integration feasibility. Straightforward inside a Saucebase app (composer install + module registration + env vars + php artisan auth:make-admin). Outside that context, integration is effectively a rewrite of the host's auth surface: you would need to reproduce the settings modal, the core navigation contract, the Inertia page-shell conventions, and the Filament panel contract. The frontend is dual-flavored (Vue and React entry points) which widens fit but also means the maintainers carry two rendering paths.
Technical risk.
agents/AGENTS.md and skills/saucebase-auth-development/SKILL.md, i.e. written for AI coding agents, not human operators. Excellent for assisted development, weak as an operational runbook.User does not implement MustVerifyEmail, so the verified middleware is a pass-through and email-verification routes are not enforced; password changes do not terminate other sessions pending AuthenticateSession in the web group (tracked as sc-714). Both are security-relevant.Modal::HEADER_MODAL / base-URL headers, and impersonation session history. Each is well-reasoned but adds regression surface, especially the modal header logic which is sensitive to header stripping by proxies/CDNs.Gate::before and UserPolicy, and permission separation between manage users and impersonate users.Key questions.
@saucebase/* package versioned compatibly?Home::url, settings discovery, and navigation registration?MustVerifyEmail be enabled, and is sc-714 (session invalidation on password change) on a committed roadmap?Stack fit. Best fit is greenfield or near-greenfield on the Saucebase starter: Laravel + Inertia + Filament + Socialite, with the module's own Inertia/Vue or Inertia/React frontend. Poor fit for an existing Laravel app with a bespoke auth implementation, blade views, or a non-Inertia SPA — the cost of retrofitting the settings modal shell, navigation registration, and Filament dependency will likely exceed the value.
Migration path.
DatabaseSeeder (grants manage users and impersonate users to nobody — assign deliberately), publish settings defaults, configure GOOGLE_* / GITHUB_* env and redirect URIs, seed an admin via php artisan auth:make-admin {email}, then toggle registration_enabled, magic_link_enabled, login_notification_enabled, and enabled_socialite_providers from AuthenticationSettings.LoginRequest, disconnect validation, admin-safety policy rules — rather than adopting the module wholesale. Reimplementing the Inertia pages and Filament resources against an existing UI kit is a multi-week effort./auth/* and /settings/*. If the host already has those routes, resolve collisions before install; the settings.* route names are load-bearing for core and PasswordChangedNotification.Compatibility. Watch for: Laravel version support, Filament v3 vs v4, stechstudio/filament-impersonate version, @saucebase/vue/@saucebase/react peer versions, and Socialite provider config. The verified middleware being a pass-through today means any host relying on it must add enforcement independently.
Sequencing.
Home::url) before enabling the module.manage users / impersonate users to named roles only.ModalLink navbar entries behave.AuthSettings, after a smoke test of login/reset/verify/magic/impersonate.MustVerifyEmail and session-invalidation posture explicitly; do not assume defaults are production-grade.Maintenance. MIT license is permissive and low-friction. The real risk is a small maintainer surface (2 stars, 0 dependents, no visible issue velocity) plus agent-oriented documentation. Plan for the team to own the module's behavior after adoption, including local forks for the two known gaps. Budget ongoing effort for Filament/Inertia major-version bumps, which will ripple through pages, resources, and route middleware.
Support. No third-party dependents means no community answer base; Slack/issue response depends entirely on the Saucebase maintainers. Internal documentation should be written at adoption time — the SKILL.md is a good agent primer but not an on-call guide. For security-sensitive failures (OAuth callback errors, lockouts, magic-link delivery), expect to self-diagnose from the exception classes (AuthException, SocialiteException) and Laravel logs.
Scaling. Auth volume is low relative to application traffic, and the hot paths are well-behaved: hashed token lookup with atomic single-use UPDATE, per-email+ip rate limiting, no unbounded growth in MagicLinkToken beyond one live token per user. Filament user management and impersonation are admin-path operations with bounded session state (recent history capped at 4 IDs). Real scaling constraints are elsewhere: email deliverability for magic links and verification, OAuth callback latency, and the shared session store if password-change invalidation is later enabled.
Failure modes.
EnsureSocialiteProviderEnabled. Misconfigured redirect URIs (default /auth/socialite/callback) are the most common break.verified later without MustVerifyEmail on User is a no-op, and enabling both without a UX pass will lock out existing sessions.can('impersonate', $target); any custom gate changes must preserve the admin pass-through invariant.Ramp-up. For a developer already fluent in Laravel, Inertia, and Filament, expect roughly 1–2 weeks to be productive and 3–4 weeks to be confident across the socialite/magic-link/modal/impersonation edges. For a team new to the Saucebase stack, double it — the module's breadth (12+ controllers, 8 listeners/notifications, dual frontend, admin plugin) means there is no small surface to learn incrementally. Use the agent skills as scaffolding for AI-assisted work, but pair it with a human-authored runbook covering OAuth setup, admin bootstrap, and the two known security gaps before any production rollout.
How can I help you explore Laravel packages today?