Skip to content

[Bug]: Setup doesn't always pop-out auth window #49

Description

@owaincuvelier

Bug Description

When running altis-cli config setup the pop-out auth doesn't occur. You need to run a command to get the auth to pop-out into a browser.

It's also been reported that running altis-cli config reset first is required, then rerunning altis-cli config setup, again, and finally running an arbitrary command seems to force the auth pop-out to happen.

Steps to Reproduce and Code Sample

  1. Run altis-cli config setup
  2. observe nothing happens.
  3. run altis-cli config reset
  4. Run altis-cli config setup again
  5. run an arbitrary command
  6. observe auth pop-out to browser occurs
  7. success

Expected Behaviour

Running altis-cli config setup should force the popout

Additional Info

Claude Findings:

F1. Root cause. lib/commands/config/setup.js never calls the login flow. It only asks "Reset?" when a token already exists, then writes config.json and prints "Saved configuration!". The OAuth browser flow lives in VantageAPI.authenticate() in lib/vantage.js and only runs on the first API request. That is why stack list opened the browser. Same code in the published 1.0.0-beta.1 (which Goh has, hence the "hm-cli" banner) and in unreleased 1.1.0.

F2. The double "Saved configuration!" Goh saw comes from config reset clearing didSetup, so the next altis-cli config setup runs the first-run wizard (which calls the setup handler) and then runs the setup command again.

Fix (2 files, +24/-12)

  • setup.js: after saving, if no token is stored, call authenticate(), wait for the callback, then print "Logged in to Altis Dashboard." Also sets didSetup itself.
  • bin/altis-cli.js: skip the first-run wizard when the invoked command is config setup, so reset-then-setup runs login once instead of wizard, login, then a "Reset?" prompt.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions