copilot-api-plus 1.2.56 → 1.2.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/main.js CHANGED
@@ -469,17 +469,35 @@ const debug = defineCommand({
469
469
 
470
470
  //#endregion
471
471
  //#region src/logout.ts
472
+ /**
473
+ * Remove the multi-account store so a subsequent login starts from a clean
474
+ * slate. Without this, `accounts.json` keeps the previous account on disk and
475
+ * the next startup loads it instead of migrating the freshly-logged-in token.
476
+ */
477
+ async function clearAccountsFile() {
478
+ try {
479
+ await fs.rm(PATHS.ACCOUNTS_PATH, { force: true });
480
+ consola.info("Multi-account store cleared");
481
+ } catch (err) {
482
+ consola.warn(`Failed to clear multi-account store: ${rootCause(err)}`);
483
+ consola.debug("Failed to clear multi-account store:", err);
484
+ }
485
+ }
472
486
  async function runLogout(options$1) {
473
487
  await ensurePaths();
474
488
  if (options$1.all || options$1.github) {
475
489
  await clearGithubToken();
490
+ await clearAccountsFile();
476
491
  consola.success("Logged out from GitHub Copilot");
477
492
  consola.info(`Token file location: ${PATHS.GITHUB_TOKEN_PATH}`);
493
+ consola.info(`Accounts file location: ${PATHS.ACCOUNTS_PATH}`);
478
494
  return;
479
495
  }
480
496
  await clearGithubToken();
497
+ await clearAccountsFile();
481
498
  consola.success("Logged out from GitHub Copilot");
482
499
  consola.info(`Token file location: ${PATHS.GITHUB_TOKEN_PATH}`);
500
+ consola.info(`Accounts file location: ${PATHS.ACCOUNTS_PATH}`);
483
501
  }
484
502
  const logout = defineCommand({
485
503
  meta: {