fdfcd1f0e2
API CI/CD / Validate (composer + pint) (push) Successful in 2m6s
API CI/CD / Build frontend assets (push) Successful in 2m20s
API CI/CD / Security audit (push) Successful in 32s
API CI/CD / Test (PHPUnit) (push) Failing after 2m17s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
Two changes:
1. app/Http/Middleware/TeacherPortalAuthenticate.php:
- Added try-catch around Auth::guard('sanctum')->user() to match
the defensive pattern used by MultiAuth and
EnsurePrintRequestsAdminAccess middleware.
2. app/Providers/AppServiceProvider.php:
- Added Auth::resolved() callback to re-register the sanctum guard
driver as a safety net. This ensures the driver is available even
when a stale cached config lacks the auth.guards.sanctum entry,
or when SanctumServiceProvider::configureGuard() runs before
the AuthManager is ready to accept custom guard creators.