From f276f2811866aa519358d6aaf3f82ea67c76ef1c Mon Sep 17 00:00:00 2001 From: wood chen Date: Thu, 20 Feb 2025 03:14:38 +0800 Subject: [PATCH] fix: Replace router.push with window.location.href in ErrorCard - Modify error redirection to use window.location.href for full page reload - Ensure proper error parameter propagation during OAuth authorization - Maintain consistent error handling behavior across different scenarios --- src/components/auth/error-card.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/auth/error-card.tsx b/src/components/auth/error-card.tsx index 2a9e607..13bfad4 100644 --- a/src/components/auth/error-card.tsx +++ b/src/components/auth/error-card.tsx @@ -1,3 +1,5 @@ +"use client"; + import { useRouter } from "next/navigation"; import { AlertCircle } from "lucide-react"; @@ -33,7 +35,7 @@ export function ErrorCard({ if (error) url.searchParams.set("error", error); if (errorDescription) url.searchParams.set("error_description", errorDescription); - router.push(url.toString()); + window.location.href = url.toString(); } else { router.push("/"); }