+9
-1
docs/app/auth/complete/page.tsx
+9
-1
docs/app/auth/complete/page.tsx
···
23
currentUrl.search || "?" + currentUrl.hash.slice(1)
24
}`;
25
26
+
// Open the URL in the system's default handler and close the window after a short delay
27
window.location.href = redirectUrl;
28
+
29
+
// Close the window after a short delay to ensure the protocol handler is triggered
30
+
setTimeout(() => {
31
+
window.close();
32
+
// Fallback message if window.close() fails (some browsers prevent it)
33
+
document.body.innerHTML =
34
+
'<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>';
35
+
}, 1500);
36
}, []);
37
38
return (