feat(cli): move provider login/logout
This commit is contained in:
@@ -1611,7 +1611,7 @@ export async function monitorWebProvider(
|
||||
|
||||
if (loggedOut) {
|
||||
runtime.error(
|
||||
"WhatsApp session logged out. Run `clawdbot login --provider web` to relink.",
|
||||
"WhatsApp session logged out. Run `clawdbot providers login --provider web` to relink.",
|
||||
);
|
||||
await closeListener();
|
||||
break;
|
||||
|
||||
@@ -70,7 +70,7 @@ export async function loginWeb(
|
||||
});
|
||||
console.error(
|
||||
danger(
|
||||
"WhatsApp reported the session is logged out. Cleared cached web session; please rerun clawdbot login and scan the QR again.",
|
||||
"WhatsApp reported the session is logged out. Cleared cached web session; please rerun clawdbot providers login and scan the QR again.",
|
||||
),
|
||||
);
|
||||
throw new Error("Session logged out; cache cleared. Re-run login.");
|
||||
|
||||
@@ -169,7 +169,9 @@ export async function createWaSocket(
|
||||
const status = getStatusCode(lastDisconnect?.error);
|
||||
if (status === DisconnectReason.loggedOut) {
|
||||
console.error(
|
||||
danger("WhatsApp session logged out. Run: clawdbot login"),
|
||||
danger(
|
||||
"WhatsApp session logged out. Run: clawdbot providers login",
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -454,7 +456,7 @@ export async function pickProvider(
|
||||
const hasWeb = await webAuthExists(authDir);
|
||||
if (!hasWeb) {
|
||||
throw new Error(
|
||||
"No WhatsApp Web session found. Run `clawdbot login --verbose` to link.",
|
||||
"No WhatsApp Web session found. Run `clawdbot providers login --verbose` to link.",
|
||||
);
|
||||
}
|
||||
return choice;
|
||||
|
||||
Reference in New Issue
Block a user