+25
-5
docs/app/auth/complete/page.tsx
+25
-5
docs/app/auth/complete/page.tsx
···
4
4
5
5
function AuthCompleteContent() {
6
6
useEffect(() => {
7
-
// Get the raw search string from the URL
8
-
const searchString = window.location.search;
7
+
// Debug logging
8
+
console.log("Current URL:", window.location.href);
9
+
console.log("Search string:", window.location.search);
10
+
console.log("Hash:", window.location.hash);
9
11
10
-
// Construct the redirect URL with the raw search string
11
-
const redirectUrl = `atprotobackups://auth${searchString}`;
12
-
console.log("Redirecting to:", redirectUrl); // Debug log
12
+
// Get all parameters from the URL
13
+
const currentUrl = new URL(window.location.href);
14
+
const params = new URLSearchParams(currentUrl.search);
15
+
16
+
// Debug log all parameters
17
+
console.log("All parameters:");
18
+
params.forEach((value, key) => {
19
+
console.log(key, "=", value);
20
+
});
21
+
22
+
// Construct the redirect URL preserving all parameters
23
+
const redirectUrl = `atprotobackups://auth${
24
+
currentUrl.search || "?" + currentUrl.hash.slice(1)
25
+
}`;
26
+
console.log("Redirecting to:", redirectUrl);
13
27
14
28
// Open the URL in the system's default handler
15
29
window.location.href = redirectUrl;
···
25
39
<p className="mt-2 text-sm text-gray-600">
26
40
Redirecting you back to the application...
27
41
</p>
42
+
<pre
43
+
id="debug"
44
+
className="mt-4 text-left text-xs text-gray-500 bg-gray-100 p-2 rounded"
45
+
>
46
+
Checking URL parameters...
47
+
</pre>
28
48
</div>
29
49
</div>
30
50
</div>