lazypush-cli 0.1.1 → 0.1.3

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/README.md CHANGED
@@ -9,6 +9,8 @@
9
9
 
10
10
  _Schedule Git commits for a future push — no local daemons, no open terminals, no guilt._
11
11
 
12
+ [Website](https://lazypush.vercel.app/) · [Docs](https://lazypush.vercel.app/docs) · [Support](https://lazypush.vercel.app/support)
13
+
12
14
  </div>
13
15
 
14
16
  ---
@@ -34,7 +34,7 @@ async function handleLogin() {
34
34
  try {
35
35
  const jwtPayload = parseJwt(token);
36
36
  if (!jwtPayload.userId) {
37
- throw new Error('Invalid token: missing userId');
37
+ throw new Error("Invalid token: missing userId");
38
38
  }
39
39
  const session = {
40
40
  token,
@@ -100,7 +100,7 @@ async function waitForOAuthCallback() {
100
100
  server.listen(port, () => {
101
101
  (0, logger_1.info)("Opening browser for GitHub authentication...");
102
102
  const apiUrl = process.env.LAZYPUSH_API || "https://lazypush.onrender.com";
103
- const redirectUri = `http://localhost:${port}/auth/callback`;
103
+ const redirectUri = `http://localhost:8000/auth/callback`;
104
104
  const loginUrl = `${apiUrl}/auth/github?redirect_uri=${encodeURIComponent(redirectUri)}`;
105
105
  (0, open_1.default)(loginUrl);
106
106
  (0, logger_1.info)("Browser opened. If it did not open, visit:");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lazypush-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Schedule Git commits for future push",
5
5
  "main": "dist/cli.js",
6
6
  "bin": {
@@ -21,7 +21,7 @@ export async function handleLogin() {
21
21
  }
22
22
 
23
23
  const token = await waitForOAuthCallback();
24
-
24
+
25
25
  if (!token) {
26
26
  error("Authentication cancelled");
27
27
  process.exit(1);
@@ -31,9 +31,9 @@ export async function handleLogin() {
31
31
  try {
32
32
  const jwtPayload = parseJwt(token);
33
33
  if (!jwtPayload.userId) {
34
- throw new Error('Invalid token: missing userId');
34
+ throw new Error("Invalid token: missing userId");
35
35
  }
36
-
36
+
37
37
  const session = {
38
38
  token,
39
39
  userId: jwtPayload.userId,
@@ -59,11 +59,14 @@ async function waitForOAuthCallback(): Promise<string | null> {
59
59
  return new Promise((resolve) => {
60
60
  let server: Server | null = null;
61
61
  const port = 3001;
62
- const timeout = setTimeout(() => {
63
- if (server) server.close();
64
- error("Login timeout - no response from GitHub");
65
- resolve(null);
66
- }, 10 * 60 * 1000); // 10 minute timeout
62
+ const timeout = setTimeout(
63
+ () => {
64
+ if (server) server.close();
65
+ error("Login timeout - no response from GitHub");
66
+ resolve(null);
67
+ },
68
+ 10 * 60 * 1000,
69
+ ); // 10 minute timeout
67
70
 
68
71
  server = createServer((req, res) => {
69
72
  if (!req.url) {
@@ -72,7 +75,6 @@ async function waitForOAuthCallback(): Promise<string | null> {
72
75
  return;
73
76
  }
74
77
 
75
-
76
78
  const urlObj = new URL(`http://localhost${req.url}`);
77
79
  const token = urlObj.searchParams.get("token");
78
80
  const errorParam = urlObj.searchParams.get("error");
@@ -101,8 +103,9 @@ async function waitForOAuthCallback(): Promise<string | null> {
101
103
 
102
104
  server.listen(port, () => {
103
105
  info("Opening browser for GitHub authentication...");
104
- const apiUrl = process.env.LAZYPUSH_API || "https://lazypush.onrender.com";
105
- const redirectUri = `http://localhost:${port}/auth/callback`;
106
+ const apiUrl =
107
+ process.env.LAZYPUSH_API || "https://lazypush.onrender.com";
108
+ const redirectUri = `http://localhost:8000/auth/callback`;
106
109
  const loginUrl = `${apiUrl}/auth/github?redirect_uri=${encodeURIComponent(redirectUri)}`;
107
110
 
108
111
  open(loginUrl);