user(); $redirectPath = $user->isAdmin() ? '/admin/dashboard' : '/client/dashboard'; return $request->wantsJson() ? new JsonResponse(['two_factor' => false], 200) : redirect()->intended($redirectPath); } }