@dream-api/sdk 0.1.10 → 0.1.11
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/dist/index.js +7 -5
- package/dist/index.mjs +7 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -221,15 +221,17 @@ var ClerkManager = class {
|
|
|
221
221
|
const urlParams = new URLSearchParams(window.location.search);
|
|
222
222
|
const ticket = urlParams.get("__clerk_ticket");
|
|
223
223
|
if (ticket && clerk.client?.signIn) {
|
|
224
|
+
urlParams.delete("__clerk_ticket");
|
|
225
|
+
const newUrl = urlParams.toString() ? `${window.location.pathname}?${urlParams}` : window.location.pathname;
|
|
226
|
+
window.history.replaceState({}, "", newUrl);
|
|
224
227
|
try {
|
|
225
228
|
console.log("[DreamAPI] Consuming sign-in ticket...");
|
|
226
229
|
await clerk.client.signIn.create({ strategy: "ticket", ticket });
|
|
227
|
-
|
|
228
|
-
const newUrl = urlParams.toString() ? `${window.location.pathname}?${urlParams}` : window.location.pathname;
|
|
229
|
-
window.history.replaceState({}, "", newUrl);
|
|
230
|
-
console.log("[DreamAPI] Sign-in ticket consumed successfully");
|
|
230
|
+
console.log("[DreamAPI] Sign-in ticket consumed");
|
|
231
231
|
} catch (err) {
|
|
232
|
-
|
|
232
|
+
if (!err?.message?.includes("already been used")) {
|
|
233
|
+
console.error("[DreamAPI] Failed to consume sign-in ticket:", err);
|
|
234
|
+
}
|
|
233
235
|
}
|
|
234
236
|
}
|
|
235
237
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -193,15 +193,17 @@ var ClerkManager = class {
|
|
|
193
193
|
const urlParams = new URLSearchParams(window.location.search);
|
|
194
194
|
const ticket = urlParams.get("__clerk_ticket");
|
|
195
195
|
if (ticket && clerk.client?.signIn) {
|
|
196
|
+
urlParams.delete("__clerk_ticket");
|
|
197
|
+
const newUrl = urlParams.toString() ? `${window.location.pathname}?${urlParams}` : window.location.pathname;
|
|
198
|
+
window.history.replaceState({}, "", newUrl);
|
|
196
199
|
try {
|
|
197
200
|
console.log("[DreamAPI] Consuming sign-in ticket...");
|
|
198
201
|
await clerk.client.signIn.create({ strategy: "ticket", ticket });
|
|
199
|
-
|
|
200
|
-
const newUrl = urlParams.toString() ? `${window.location.pathname}?${urlParams}` : window.location.pathname;
|
|
201
|
-
window.history.replaceState({}, "", newUrl);
|
|
202
|
-
console.log("[DreamAPI] Sign-in ticket consumed successfully");
|
|
202
|
+
console.log("[DreamAPI] Sign-in ticket consumed");
|
|
203
203
|
} catch (err) {
|
|
204
|
-
|
|
204
|
+
if (!err?.message?.includes("already been used")) {
|
|
205
|
+
console.error("[DreamAPI] Failed to consume sign-in ticket:", err);
|
|
206
|
+
}
|
|
205
207
|
}
|
|
206
208
|
}
|
|
207
209
|
}
|