@amaster.ai/runtime-cli 1.1.70 → 1.1.71

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.cjs CHANGED
@@ -3219,10 +3219,12 @@ function createAmasterClient(appCode) {
3219
3219
  process.exit(1);
3220
3220
  }
3221
3221
  const token = getAccessToken(appCode);
3222
- if (token && shouldRefreshToken(appCode)) {
3222
+ const refreshManagedExternally = getAuthSession(appCode)?.refreshManagedExternally === true;
3223
+ if (token && !refreshManagedExternally && shouldRefreshToken(appCode)) {
3223
3224
  console.error(chalk4__default.default.yellow("\u26A0\uFE0F Session expiring soon. Please login again."));
3224
3225
  }
3225
3226
  const client$1 = client.createClient({
3227
+ autoRefresh: !refreshManagedExternally,
3226
3228
  baseURL: appConfig.baseURL,
3227
3229
  headers: {
3228
3230
  "x-app-code": appCode,
@@ -3231,6 +3233,10 @@ function createAmasterClient(appCode) {
3231
3233
  } : {}
3232
3234
  },
3233
3235
  onUnauthorized: () => {
3236
+ if (refreshManagedExternally) {
3237
+ console.error(chalk4__default.default.red("Application authorization expired or was denied. Renew through the execution host and retry."));
3238
+ process.exit(1);
3239
+ }
3234
3240
  if (token) {
3235
3241
  console.error(chalk4__default.default.red("\n\u274C Session expired. Please login again."));
3236
3242
  console.error(chalk4__default.default.yellow(`Run: amaster login --app ${appCode}`));