The Gatekeeper (Auth)
Jengo's "Gatekeeper" provides a robust, beautifully styled authentication system out of the box, built on top of the official CodeIgniter Shield.
Installation
The easiest way to get the Gatekeeper is to use the --auth flag during project creation:
jengo new my-app --authIf you already have a Jengo project and want to add authentication later, you can run:
php spark jengo:setup authSmart Integration
The Jengo installer is smart enough to adapt the authentication UI based on your chosen starter kit.
1. Default PHP Kit
If you are using the default PHP kit, the installer will publish highly polished, Tailwind-styled login.php and register.php views directly into app/Views/Shield/. It automatically configures Shield to use these custom views instead of the default ones.
2. Inertia SPA Kits (React, Vue, Svelte)
If you install the Gatekeeper alongside an Inertia kit, Jengo skips the PHP views entirely. Instead, it:
- Publishes a suite of Inertia-friendly controllers to
app/Controllers/Auth/:LoginController: Handles SPA login and logout.RegisterController: Handles SPA user registration.MagicLinkController: Manages email-based, passwordless login.ActionController: Handles multi-step auth actions (e.g., 2FA, Email Verification).
- Re-routes the default Shield endpoints to these custom controllers.
- Scaffolds complete, working authentication pages in your chosen framework (React, Vue, or Svelte).
This ensures a seamless, page-refresh-free authentication experience for modern Single Page Applications.
