@topolo/cli 0.4.2 → 0.4.3

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.
Files changed (2) hide show
  1. package/dist/index.js +7 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -11228,10 +11228,16 @@ function registerContextCommand(program2) {
11228
11228
  const config = await readConfig();
11229
11229
  const profile = profileForEnvironment(config, environment);
11230
11230
  const serviceUrls = resolvedProfileConfig(config, environment).serviceUrls;
11231
- const cred = await refreshCredentialIfNeeded(environment);
11231
+ const priorCredential = profile.credential ?? (profile.activeContext ? profile.contexts?.[profile.activeContext]?.credential : void 0);
11232
+ const cred = await refreshCredentialIfNeeded(environment, { force: true });
11232
11233
  if (!cred) {
11233
11234
  throw new Error("Not signed in. Run `topolo auth login` first.");
11234
11235
  }
11236
+ if (priorCredential?.kind === "access_token" && priorCredential.refreshToken && cred.kind === "access_token" && cred.accessToken === priorCredential.accessToken) {
11237
+ throw new Error(
11238
+ `The active credential could not be refreshed. Run \`topolo --env ${environment} auth login\` to sign in again.`
11239
+ );
11240
+ }
11235
11241
  const wantPersonal = /^(personal|me)$/i.test(target.trim());
11236
11242
  let resolved;
11237
11243
  const needle = target.trim().toLowerCase();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topolo/cli",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "Command-line interface for Topolo developers, operators, and agents, with internal first-party scaffolding available under the topolo platform namespace.",
5
5
  "type": "module",
6
6
  "bin": {