๐ Leaf PHP auth module
Repo leafsphp/auth, read from GitHub 6 h ago. leafsphp has not joined Take My Repo.
Role and permission middlewares (is, isNot, can, cannot) no longer fatal on Leaf 4: when Leaf\Crash\Pages isn't available they return a plain 403. Leaf 5 behaviour is unchanged. (#68)
Auth::user() no longer regenerates the session ID on every call, which stops cookie churn and broken parallel requests while keeping sliding session expiry (thanks @bennito254)logout($url) only redirects when Leaf's response() helper is available, so auth works without the full Leaf framework (thanks @fadrian06)leafs/http. If you use Leaf\Http classes without leafs/leaf, run composer require leafs/http. Apps on the full Leaf framework are unaffected (thanks @fadrian06)leafs/db ^5.1 and firebase/php-jwt ^7.1redirect.login and redirect.guest config so you can point auth's middleware redirects at your own routes instead of the default /auth/login and /dashboard.$user->get() now never returns your password hash or remember token, no matter how the hidden config is set. Hiding your id and password also follows your configured column names, so renaming a column never exposes it by accident.errors() reports only the operation you just ran instead of accumulating results from earlier callsnull, so a fresh user's roles column never leaks into get() outputtoken.secret config, then AUTH_TOKEN_SECRET from your .env, then a secret derived from your APP_KEY. If none of the three exist, token operations throw a clear error instead of signing with a fallback. Leaf MVC apps configure this already and are unaffected โ lite apps with an APP_KEY need no changes either