048d48de6a
API CI/CD / Validate (composer + pint) (push) Successful in 2m7s
API CI/CD / Build frontend assets (push) Successful in 2m26s
API CI/CD / Security audit (push) Successful in 32s
API CI/CD / Test (PHPUnit) (push) Failing after 2m22s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
The badge route group (form-data, pdf, print-status, log-print) was
accidentally nested inside the multi.auth middleware group that
started at line 567 (for legacy teacher routes). This caused:
1. All badge routes to inherit multi.auth middleware, which
calls Auth::guard('sanctum')->user() at every request
2. Auth guard [sanctum] not defined errors when the sanctum
driver wasn't yet registered (config cache / provider order)
Fix: close the large multi.auth group BEFORE the badge routes,
then apply middleware('multi.auth') explicitly to the badge
prefix group. This keeps auth on badge endpoints but avoids
the accidental nesting issue.