kalvium-worklog 1.2.0 → 1.3.1
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/capture-token.js +28 -5
- package/dist/cli.js +3 -1
- package/package.json +1 -1
package/dist/capture-token.js
CHANGED
|
@@ -82,16 +82,39 @@ async function tryCapture(headless) {
|
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
84
84
|
console.log("\n ========================================");
|
|
85
|
-
console.log(" Browser opened.
|
|
86
|
-
console.log("
|
|
87
|
-
console.log(" 2. Sign in with your Kalvium account");
|
|
88
|
-
console.log(" 3. Complete 2FA if prompted");
|
|
89
|
-
console.log(" 4. Wait — the script continues automatically");
|
|
85
|
+
console.log(" Browser opened. Auto-clicking 'Continue with Google'...");
|
|
86
|
+
console.log(" Please complete 2FA if prompted.");
|
|
90
87
|
console.log(" ========================================\n");
|
|
91
88
|
await page.goto("https://kalvium.community/internships", {
|
|
92
89
|
waitUntil: "domcontentloaded",
|
|
93
90
|
timeout: 120000,
|
|
94
91
|
});
|
|
92
|
+
// Auto-click "Continue with Google" button
|
|
93
|
+
try {
|
|
94
|
+
// Try common selectors for the Google login button
|
|
95
|
+
const googleBtn = await page
|
|
96
|
+
.locator("text=Continue with Google")
|
|
97
|
+
.first();
|
|
98
|
+
const isVisible = await googleBtn
|
|
99
|
+
.isVisible()
|
|
100
|
+
.catch(() => false);
|
|
101
|
+
if (isVisible) {
|
|
102
|
+
await googleBtn.click();
|
|
103
|
+
console.log(" Clicked 'Continue with Google'.");
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
// Fallback: try other patterns
|
|
107
|
+
await page
|
|
108
|
+
.locator("button:has-text('Google'), a:has-text('Google')")
|
|
109
|
+
.first()
|
|
110
|
+
.click({ timeout: 5000 })
|
|
111
|
+
.catch(() => { });
|
|
112
|
+
console.log(" Clicked Google login button.");
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch {
|
|
116
|
+
console.log(" Could not auto-click. Please click 'Continue with Google' manually.");
|
|
117
|
+
}
|
|
95
118
|
console.log(" Waiting for login to complete (up to 5 minutes)...");
|
|
96
119
|
// Poll up to 5 minutes
|
|
97
120
|
for (let i = 0; i < 300; i++) {
|
package/dist/cli.js
CHANGED
|
@@ -53,8 +53,10 @@ program
|
|
|
53
53
|
text: text ?? "Working on assigned task",
|
|
54
54
|
dryRun: opts.dryRun,
|
|
55
55
|
});
|
|
56
|
-
if (!result.success)
|
|
56
|
+
if (!result.success) {
|
|
57
|
+
console.log(`ERROR: ${result.message}`);
|
|
57
58
|
process.exit(1);
|
|
59
|
+
}
|
|
58
60
|
});
|
|
59
61
|
// ─── status ────────────────────────────────────────────────────────────────
|
|
60
62
|
program
|