@authly/sdk 1.2.1 → 1.2.2
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
"use client";
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.AuthlyCallback = void 0;
|
|
4
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -15,11 +16,15 @@ const AuthlyCallback = ({ onSuccess = "/", onFailure = "/login", navigate }) =>
|
|
|
15
16
|
const params = new URLSearchParams(window.location.search);
|
|
16
17
|
const code = params.get("code");
|
|
17
18
|
const state = params.get("state");
|
|
19
|
+
console.log("[AuthlyCallback] Processing callback...", { code: !!code, state: !!state });
|
|
18
20
|
if (!code || !state) {
|
|
21
|
+
console.warn("[AuthlyCallback] Missing code or state parameters.");
|
|
19
22
|
return;
|
|
20
23
|
}
|
|
21
24
|
try {
|
|
25
|
+
console.log("[AuthlyCallback] Exchanging token...");
|
|
22
26
|
await client.exchangeToken(params);
|
|
27
|
+
console.log("[AuthlyCallback] Token exchanged successfully.");
|
|
23
28
|
await refresh();
|
|
24
29
|
if (navigate) {
|
|
25
30
|
navigate(onSuccess);
|