@lanonasis/cli 3.9.1 → 3.9.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog - @lanonasis/cli
2
2
 
3
+ ## [3.9.2] - 2026-02-02
4
+
5
+ ### 🐛 Bug Fixes
6
+
7
+ - **Auth Method Override**: Fixed vendor key authentication not overriding previous OAuth `authMethod`
8
+ - When users explicitly authenticate with vendor key after OAuth, the `authMethod` is now correctly set to `vendor_key`
9
+ - This fixes "Authenticated: No" status after successful vendor key authentication
10
+ - Reverted changes from 3.9.1 that incorrectly removed vendor key storage from OAuth flow
11
+
3
12
  ## [3.9.1] - 2026-02-01
4
13
 
5
14
  ### 🔐 Authentication Fixes
@@ -606,6 +606,10 @@ async function handleVendorKeyAuth(vendorKey, config) {
606
606
  const spinner = ora('Validating vendor key...').start();
607
607
  try {
608
608
  await config.setVendorKey(vendorKey);
609
+ // Explicitly set authMethod to vendor_key when user does explicit vendor key auth
610
+ // This overrides any previous OAuth authMethod
611
+ await config.set('authMethod', 'vendor_key');
612
+ await config.save();
609
613
  // Test the vendor key with a health check
610
614
  await apiClient.get('/health');
611
615
  spinner.succeed('Vendor key authentication successful');
@@ -702,22 +706,23 @@ async function handleOAuthFlow(config) {
702
706
  }
703
707
  const tokens = await exchangeCodeForTokens(code, pkce.verifier, authBase, redirectUri);
704
708
  spinner.succeed('Access tokens received');
705
- // Store OAuth tokens - these are auth-gateway tokens from /oauth/token
706
- // Note: OAuth tokens are valid for MCP services but not for direct API access
709
+ // Store OAuth tokens - these are already valid auth-gateway tokens from /oauth/token
710
+ // No need for additional exchange since /oauth/token returns auth-gateway's own tokens
707
711
  await config.setToken(tokens.access_token);
708
712
  await config.set('refresh_token', tokens.refresh_token);
709
713
  await config.set('token_expires_at', Date.now() + (tokens.expires_in * 1000));
710
714
  await config.set('authMethod', 'oauth');
711
- spinner.succeed('OAuth tokens stored');
715
+ // The OAuth access token from auth-gateway works as the API token for all services
716
+ // Store it as the vendor key equivalent for MCP and API access
717
+ spinner.text = 'Configuring unified access...';
718
+ spinner.start();
719
+ // Use the OAuth access token directly - it's already an auth-gateway token
720
+ await config.setVendorKey(tokens.access_token);
721
+ spinner.succeed('Unified authentication configured');
712
722
  console.log();
713
723
  console.log(chalk.green('✓ OAuth2 authentication successful'));
714
- console.log(colors.info('You can now use MCP integration features'));
715
- console.log();
716
- console.log(chalk.yellow('Note: ') + chalk.gray('OAuth login enables MCP integration.'));
717
- console.log(chalk.gray('For direct CLI memory commands, use:'));
718
- console.log(chalk.cyan(' lanonasis auth login --vendor') + chalk.gray(' (get a vendor key from dashboard)'));
719
- console.log(chalk.gray(' OR'));
720
- console.log(chalk.cyan(' lanonasis auth login --credentials') + chalk.gray(' (use username/password)'));
724
+ console.log(colors.info('You can now use all Lanonasis services'));
725
+ console.log(chalk.gray('✓ MCP, API, and CLI access configured'));
721
726
  process.exit(0);
722
727
  }
723
728
  catch (error) {
package/dist/utils/api.js CHANGED
@@ -60,17 +60,7 @@ export class APIClient {
60
60
  const { status, data } = error.response;
61
61
  if (status === 401) {
62
62
  console.error(chalk.red('✖ Authentication failed'));
63
- // Check if user is using OAuth - OAuth tokens only work with MCP, not direct API
64
- const authMethod = this.config.get('authMethod');
65
- if (authMethod === 'oauth') {
66
- console.log(chalk.yellow('\nNote: OAuth tokens are for MCP integration only.'));
67
- console.log(chalk.gray('For direct API access, you have two options:'));
68
- console.log(chalk.gray(' 1. Get a vendor key from the dashboard: ') + chalk.cyan('lanonasis auth login --vendor'));
69
- console.log(chalk.gray(' 2. Login with username/password: ') + chalk.cyan('lanonasis auth login --credentials'));
70
- }
71
- else {
72
- console.log(chalk.yellow('Please run:'), chalk.white('lanonasis auth login'));
73
- }
63
+ console.log(chalk.yellow('Please run:'), chalk.white('memory login'));
74
64
  process.exit(1);
75
65
  }
76
66
  if (status === 403) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lanonasis/cli",
3
- "version": "3.9.1",
3
+ "version": "3.9.2",
4
4
  "description": "Professional CLI for LanOnasis Memory as a Service (MaaS) with MCP support, seamless inline editing, and enterprise-grade security",
5
5
  "keywords": [
6
6
  "lanonasis",