@yadurajfleetos/cli 0.1.1 → 0.1.2

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.
@@ -189,8 +189,22 @@ export const authCommand = {
189
189
  authData = await task('verifying credentials', async () => (await request('POST', '/auth/login', { body: { email, password }, auth: false, profile })).body, { hints: ['the control plane never stores your password in this CLI'] });
190
190
  }
191
191
  else {
192
- // Default: Modern Browser Web OAuth Login
193
- authData = await browserAuth(profile);
192
+ // Default: Modern Browser Web OAuth Login with fallback for older control planes
193
+ try {
194
+ authData = await browserAuth(profile);
195
+ }
196
+ catch (err) {
197
+ const isNotFound = err instanceof CliError && /no route|not found|404/i.test(err.message);
198
+ if (isNotFound) {
199
+ console.log(c.dim(' (control plane does not support browser auth — using terminal login)\n'));
200
+ const email = await requiredPrompt('email');
201
+ const password = await requiredPrompt('password', { silent: true, hint: 'Password is hidden while you type.' });
202
+ authData = await task('verifying credentials', async () => (await request('POST', '/auth/login', { body: { email, password }, auth: false, profile })).body, { hints: ['the control plane never stores your password in this CLI'] });
203
+ }
204
+ else {
205
+ throw err;
206
+ }
207
+ }
194
208
  }
195
209
  await saveProfile({
196
210
  ...profile,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yadurajfleetos/cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Fleet OS command-line interface for deploying and orchestrating services on user-owned hardware",
5
5
  "type": "module",
6
6
  "license": "MIT",