kalvium-worklog 1.3.1 → 1.3.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.
@@ -72,9 +72,28 @@ async function tryCapture(headless) {
72
72
  timeout: 30000,
73
73
  });
74
74
  await page
75
- .waitForLoadState("networkidle", { timeout: 20000 })
75
+ .waitForLoadState("networkidle", { timeout: 10000 })
76
76
  .catch(() => { });
77
- await page.waitForTimeout(8000);
77
+ // Auto-click "Continue with Google" in headless mode too.
78
+ // If the Google session is still valid in the persistent profile,
79
+ // this completes the entire login invisibly — no browser window,
80
+ // no user interaction needed.
81
+ const googleBtn = page.locator("text=Continue with Google").first();
82
+ const isVisible = await googleBtn.isVisible().catch(() => false);
83
+ if (isVisible) {
84
+ await googleBtn.click();
85
+ console.log(" Clicked 'Continue with Google' (headless)...");
86
+ // Wait for token exchange after auto-click
87
+ for (let i = 0; i < 15; i++) {
88
+ if (tokenData.data)
89
+ break;
90
+ await page.waitForTimeout(1000);
91
+ }
92
+ }
93
+ // If still no token, wait a bit more for any redirects
94
+ if (!tokenData.data) {
95
+ await page.waitForTimeout(5000);
96
+ }
78
97
  }
79
98
  catch {
80
99
  // ignore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kalvium-worklog",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "description": "Auto-submit your daily Kalvium worklog without opening the website",
5
5
  "keywords": [
6
6
  "kalvium",