diff --git a/surfsense_backend/app/routes/documents_routes.py b/surfsense_backend/app/routes/documents_routes.py index b75c56663..3ea1e8e61 100644 --- a/surfsense_backend/app/routes/documents_routes.py +++ b/surfsense_backend/app/routes/documents_routes.py @@ -157,7 +157,7 @@ async def create_documents_file_upload( @router.get("/documents/", response_model=list[DocumentRead]) async def read_documents( skip: int = 0, - limit: int = 3000, + limit: int = 300, search_space_id: int | None = None, session: AsyncSession = Depends(get_async_session), user: User = Depends(current_active_user), diff --git a/surfsense_web/app/login/LocalLoginForm.tsx b/surfsense_web/app/login/LocalLoginForm.tsx index 2a4d9239a..b464bea98 100644 --- a/surfsense_web/app/login/LocalLoginForm.tsx +++ b/surfsense_web/app/login/LocalLoginForm.tsx @@ -1,10 +1,10 @@ "use client"; +import { AnimatePresence, motion } from "framer-motion"; import Link from "next/link"; import { useRouter } from "next/navigation"; import { useEffect, useState } from "react"; -import { motion, AnimatePresence } from "framer-motion"; import { toast } from "sonner"; -import { getAuthErrorDetails, shouldRetry, isNetworkError } from "@/lib/auth-errors"; +import { getAuthErrorDetails, isNetworkError, shouldRetry } from "@/lib/auth-errors"; export function LocalLoginForm() { const [username, setUsername] = useState(""); @@ -64,31 +64,30 @@ export function LocalLoginForm() { setTimeout(() => { router.push(`/auth/callback?token=${data.access_token}`); }, 500); - } catch (err) { // Use auth-errors utility to get proper error details let errorCode = "UNKNOWN_ERROR"; - + if (err instanceof Error) { errorCode = err.message; } else if (isNetworkError(err)) { errorCode = "NETWORK_ERROR"; } - + // Get detailed error information from auth-errors utility const errorDetails = getAuthErrorDetails(errorCode); - + // Set persistent error display setErrorTitle(errorDetails.title); setError(errorDetails.description); - + // Show error toast with conditional retry action const toastOptions: any = { id: loadingToast, description: errorDetails.description, duration: 6000, }; - + // Add retry action if the error is retryable if (shouldRetry(errorCode)) { toastOptions.action = { @@ -96,7 +95,7 @@ export function LocalLoginForm() { onClick: () => handleSubmit(e), }; } - + toast.error(errorDetails.title, toastOptions); } finally { setIsLoading(false); @@ -136,9 +135,7 @@ export function LocalLoginForm() {

{errorTitle}

-

- {error} -

+

{error}