@clawchatsai/connector 0.0.56 → 0.0.57
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/index.js +14 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -785,8 +785,21 @@ async function handleSetup(token) {
|
|
|
785
785
|
fs.mkdirSync(dataDir, { recursive: true });
|
|
786
786
|
fs.mkdirSync(uploadsDir, { recursive: true });
|
|
787
787
|
ws.close();
|
|
788
|
+
// Ask if user wants to reuse TOTP from another gateway
|
|
789
|
+
let reuseSecret;
|
|
790
|
+
if (config.schemaVersion === 1) {
|
|
791
|
+
const rlSetup = (await import('node:readline')).createInterface({ input: process.stdin, output: process.stdout });
|
|
792
|
+
const askSetup = (q) => new Promise(r => rlSetup.question(q, r));
|
|
793
|
+
console.log('');
|
|
794
|
+
console.log(' 💡 Already have ClawChats on another gateway?');
|
|
795
|
+
console.log(' Run \`openclaw clawchats show-totp\` on that machine and paste the secret below.');
|
|
796
|
+
const reuseAnswer = await askSetup(' Paste existing TOTP secret to reuse it (or press Enter to set up new): ');
|
|
797
|
+
rlSetup.close();
|
|
798
|
+
if (reuseAnswer.trim())
|
|
799
|
+
reuseSecret = reuseAnswer.trim();
|
|
800
|
+
}
|
|
788
801
|
// Enroll TOTP (interactive — requires stdin)
|
|
789
|
-
const totpOk = await enrollTotp(config);
|
|
802
|
+
const totpOk = await enrollTotp(config, reuseSecret);
|
|
790
803
|
if (!totpOk) {
|
|
791
804
|
console.log('');
|
|
792
805
|
console.log(' ⚠️ TOTP not configured. You can set it up later with: openclaw clawchats reauth');
|