@kervnet/opencode-kiro-auth 1.7.11 → 1.7.12
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.
|
@@ -25,6 +25,18 @@ export class AuthHandler {
|
|
|
25
25
|
try {
|
|
26
26
|
const logger = await import('../../plugin/logger.js');
|
|
27
27
|
logger.log('Background token refresh starting...');
|
|
28
|
+
// Force kiro-cli to refresh its token first
|
|
29
|
+
try {
|
|
30
|
+
const { exec } = await import('node:child_process');
|
|
31
|
+
await new Promise((resolve) => {
|
|
32
|
+
exec('kiro-cli whoami', (error) => {
|
|
33
|
+
resolve(); // Continue even if it fails
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
catch (e) {
|
|
38
|
+
// Silent fail - continue with sync anyway
|
|
39
|
+
}
|
|
28
40
|
const { syncFromKiroCli } = await import('../../plugin/sync/kiro-cli.js');
|
|
29
41
|
await syncFromKiroCli();
|
|
30
42
|
logger.log('Background token refresh completed');
|
|
@@ -33,6 +33,18 @@ export class TokenRefresher {
|
|
|
33
33
|
const now = Date.now();
|
|
34
34
|
if (this.config.auto_sync_kiro_cli && now - this.lastSyncTime > this.SYNC_COOLDOWN_MS) {
|
|
35
35
|
this.lastSyncTime = now;
|
|
36
|
+
// Force kiro-cli to refresh its token first
|
|
37
|
+
try {
|
|
38
|
+
const { exec } = await import('node:child_process');
|
|
39
|
+
await new Promise((resolve) => {
|
|
40
|
+
exec('kiro-cli whoami', (error) => {
|
|
41
|
+
resolve(); // Continue even if it fails
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
// Silent fail - continue with sync anyway
|
|
47
|
+
}
|
|
36
48
|
await this.syncFromKiroCli();
|
|
37
49
|
}
|
|
38
50
|
this.repository.invalidateCache();
|
package/package.json
CHANGED