salesprompter-cli 0.1.9 → 0.1.10
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/auth.js +21 -1
- package/package.json +1 -1
package/dist/auth.js
CHANGED
|
@@ -25,6 +25,26 @@ const AuthSessionSchema = z.object({
|
|
|
25
25
|
expiresAt: z.string().datetime().optional(),
|
|
26
26
|
createdAt: z.string().datetime()
|
|
27
27
|
});
|
|
28
|
+
function buildBrowserCallbackSuccessHtml() {
|
|
29
|
+
return [
|
|
30
|
+
"<!doctype html>",
|
|
31
|
+
"<html>",
|
|
32
|
+
"<head>",
|
|
33
|
+
'<meta charset="utf-8">',
|
|
34
|
+
"<title>Salesprompter CLI login complete</title>",
|
|
35
|
+
'<meta name="viewport" content="width=device-width, initial-scale=1">',
|
|
36
|
+
"<script>",
|
|
37
|
+
"if (window.history && typeof window.history.replaceState === 'function') {",
|
|
38
|
+
" window.history.replaceState(null, document.title, window.location.pathname);",
|
|
39
|
+
"}",
|
|
40
|
+
"</script>",
|
|
41
|
+
"</head>",
|
|
42
|
+
"<body>",
|
|
43
|
+
"<p>Salesprompter CLI login complete. You can return to the terminal.</p>",
|
|
44
|
+
"</body>",
|
|
45
|
+
"</html>"
|
|
46
|
+
].join("");
|
|
47
|
+
}
|
|
28
48
|
const DeviceStartResponseSchema = z.object({
|
|
29
49
|
deviceCode: z.string().min(1),
|
|
30
50
|
userCode: z.string().min(1),
|
|
@@ -247,7 +267,7 @@ export async function loginWithBrowserConnect(options) {
|
|
|
247
267
|
}
|
|
248
268
|
response.statusCode = 200;
|
|
249
269
|
response.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
250
|
-
response.end(
|
|
270
|
+
response.end(buildBrowserCallbackSuccessHtml());
|
|
251
271
|
resolveToken?.({ accessToken, state: responseState });
|
|
252
272
|
}
|
|
253
273
|
catch (error) {
|
package/package.json
CHANGED