···2323 currentUrl.search || "?" + currentUrl.hash.slice(1)
2424 }`;
25252626- // Open the URL in the system's default handler
2626+ // Open the URL in the system's default handler and close the window after a short delay
2727 window.location.href = redirectUrl;
2828+2929+ // Close the window after a short delay to ensure the protocol handler is triggered
3030+ setTimeout(() => {
3131+ window.close();
3232+ // Fallback message if window.close() fails (some browsers prevent it)
3333+ document.body.innerHTML =
3434+ '<div class="min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-50 to-indigo-50"><div class="max-w-md w-full p-8 text-center"><p class="text-lg text-gray-600">Authentication complete! You can close this window.</p></div></div>';
3535+ }, 1500);
2836 }, []);
29373038 return (