@clawcard/cli 1.0.5 → 1.0.6
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 +1 -1
- package/src/commands/login.js +1 -13
- package/src/commands/signup.js +1 -12
package/package.json
CHANGED
package/src/commands/login.js
CHANGED
|
@@ -49,19 +49,7 @@ async function pollForToken(code, timeout = 120_000) {
|
|
|
49
49
|
const data = await res.json();
|
|
50
50
|
|
|
51
51
|
if (data.status === "complete" && data.token) {
|
|
52
|
-
|
|
53
|
-
let email = "";
|
|
54
|
-
try {
|
|
55
|
-
const meRes = await fetch(`${BASE_URL}/api/me`, {
|
|
56
|
-
headers: { Authorization: `Bearer ${data.token}` },
|
|
57
|
-
});
|
|
58
|
-
const me = await meRes.json();
|
|
59
|
-
email = me.email || "";
|
|
60
|
-
} catch {
|
|
61
|
-
// non-critical
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return { token: data.token, email };
|
|
52
|
+
return { token: data.token, email: data.email || "" };
|
|
65
53
|
}
|
|
66
54
|
} catch {
|
|
67
55
|
// network error, keep polling
|
package/src/commands/signup.js
CHANGED
|
@@ -57,18 +57,7 @@ async function pollForToken(code, timeout = 120_000) {
|
|
|
57
57
|
const data = await res.json();
|
|
58
58
|
|
|
59
59
|
if (data.status === "complete" && data.token) {
|
|
60
|
-
|
|
61
|
-
try {
|
|
62
|
-
const meRes = await fetch(`${BASE_URL}/api/me`, {
|
|
63
|
-
headers: { Authorization: `Bearer ${data.token}` },
|
|
64
|
-
});
|
|
65
|
-
const me = await meRes.json();
|
|
66
|
-
email = me.email || "";
|
|
67
|
-
} catch {
|
|
68
|
-
// non-critical
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return { token: data.token, email };
|
|
60
|
+
return { token: data.token, email: data.email || "" };
|
|
72
61
|
}
|
|
73
62
|
} catch {
|
|
74
63
|
// network error, keep polling
|