Authentication module package for Stackmint.
This package is intended to be installed into a Stackmint app and linked into the app's Modules/ directory by the module installer command.
It is intentionally kept app-agnostic. The package should handle authentication concerns, not app domain features or foundational app schema.
- Composer package:
startermint/stackmint-auth - GitHub repo:
startermint/stackmint-auth
From a Stackmint app:
php wayfinder module:install authThat should:
- require
startermint/stackmint-authwith Composer - create a symlink at
Modules/Auth
The auth alias itself belongs in the host app's config/modules.php package map. It should not be hard-coded as package-owned metadata inside stackmint-auth.
The auth package redirects to auth.home_route after registration, and after login when there is no intended protected destination stored in session.
Configure that in the host app's config/auth.php:
return [
'home_route' => '/dashboard',
];Or through environment config if your app maps it:
AUTH_HOME_ROUTE=/dashboardLogin behavior is:
- if
auth.intendedexists in session, redirect there - otherwise redirect to
auth.home_route
Registration behavior is:
- create the user
- log them in
- redirect to
auth.home_route
That means the host application controls the final destination page. In a simple app it might be /dashboard; in another app it could be /projects, /app, or any other authenticated landing page.
startermint/stackmint-auth should not own the application's core users table migration. That table belongs in the starter app or host application so each app can control its user schema directly.
If this package ever needs additional auth-specific tables, those should be limited to auth concerns only.
This package keeps the module source at the package root so the linked Modules/Auth directory remains the module root that Stackmint already expects.