Skip to content

[CLI] JWT token contains invalid host (localhost:8081) when logging in to self-hosted instance #135

@NiketanG

Description

@NiketanG

Description

When using a self-hosted instance of Packmind and logging in via the CLI using:

packmind-cli login --host <host_url>

The returned JWT token, when decoded, contains an invalid host value of http://localhost:8081 instead of the provided <host_url>.

This causes all subsequent CLI operations (e.g. installing packages) to fail, as the token carries the wrong host.

Steps to Reproduce

  1. Set up a self-hosted Packmind instance at a custom host URL (e.g. https://my-packmind-instance.example.com)
  2. Run packmind-cli login --host https://my-packmind-instance.example.com
  3. Complete the login flow successfully
  4. Decode the returned JWT token
  5. Observe that the host field inside the token is http://localhost:8081 instead of the provided host URL
  6. Attempt to run any subsequent CLI command (e.g. packmind-cli install)

Expected Behavior

The JWT token returned after packmind-cli login --host <host_url> should contain the correct host URL that was passed via the --host flag. Subsequent CLI commands should work correctly using this token.

Actual Behavior

The JWT token contains http://localhost:8081 as the host, regardless of the --host value provided during login. This causes all subsequent CLI commands (such as package installation) to fail because they resolve to the wrong host.

Environment

  • Packmind instance type: Self-hosted
  • CLI command used: packmind-cli login --host <host_url>
  • Issue observed: In decoded JWT payload (e.g. during packmind-cli install)
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions