diff --git a/src/app/(auth)/authorize/page.tsx b/src/app/(auth)/authorize/page.tsx index f2e2a48..605d7df 100644 --- a/src/app/(auth)/authorize/page.tsx +++ b/src/app/(auth)/authorize/page.tsx @@ -1,6 +1,8 @@ "use client"; +import { useEffect } from "react"; import Link from "next/link"; +import { useRouter, useSearchParams } from "next/navigation"; import { MessageCircleCode } from "lucide-react"; import { UserAuthorize } from "@/components/auth/user-authorize"; @@ -10,6 +12,16 @@ type Props = { }; export default function AuthPage({ searchParams }: Props) { + const router = useRouter(); + const urlSearchParams = useSearchParams(); + const callbackUrl = urlSearchParams.get("callbackUrl"); + + useEffect(() => { + if (callbackUrl) { + router.replace(callbackUrl); + } + }, [callbackUrl, router]); + return (