Commit a2aecfda authored by DevPilot's avatar DevPilot

fix(companies): send pending companies to their status screen instead of a bare 403

Co-Authored-By: 's avatarClaude Opus 5.5 <noreply@anthropic.com>
parent 75ab1d67
......@@ -17,7 +17,12 @@ class EnsureCompanyApproved
}
if (!$user->companyProfile || $user->companyProfile->status !== 'approved') {
abort(403, __('company.not_approved'));
if ($request->expectsJson()) {
abort(403, __('company.not_approved'));
}
// The dashboard renders the pending/rejected status screen.
return redirect()->route('company.dashboard');
}
return $next($request);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment