@fastshot/auth 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/auth.ts
CHANGED
|
@@ -123,6 +123,12 @@ async function signInWithProvider(
|
|
|
123
123
|
if (!callbackResult.success) {
|
|
124
124
|
throw createAuthError('UNKNOWN_ERROR', callbackResult.error || 'Failed to complete authentication');
|
|
125
125
|
}
|
|
126
|
+
} else {
|
|
127
|
+
// Handle unexpected browser result (e.g., success without URL)
|
|
128
|
+
throw createAuthError(
|
|
129
|
+
'UNKNOWN_ERROR',
|
|
130
|
+
`Unexpected auth result: type=${result.type}, hasUrl=${!!(result as any).url}`
|
|
131
|
+
);
|
|
126
132
|
}
|
|
127
133
|
}
|
|
128
134
|
|
package/src/utils/deepLink.ts
CHANGED
|
@@ -36,7 +36,14 @@ export function parseCallbackUrl(url: string): {
|
|
|
36
36
|
return {};
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
// Get query string and strip any URL fragment (#)
|
|
40
|
+
// iOS often appends a trailing # to callback URLs
|
|
41
|
+
let queryString = url.substring(queryStart + 1);
|
|
42
|
+
const hashIndex = queryString.indexOf('#');
|
|
43
|
+
if (hashIndex !== -1) {
|
|
44
|
+
queryString = queryString.substring(0, hashIndex);
|
|
45
|
+
}
|
|
46
|
+
|
|
40
47
|
const params = new URLSearchParams(queryString);
|
|
41
48
|
|
|
42
49
|
return {
|