handleCallback($code, $state)) { header('Location: ' . Bootstrap::url('portal/index.php')); exit; } // Distinguish "signed in but not allowlisted" is not possible here without extra state; // a generic failure keeps the flow simple and avoids leaking allowlist membership. header('Location: ' . Bootstrap::url('portal/login.php?error=auth_failed')); exit;