Skip to content

FLAGSMITH_API_KEY is silently ignored for self-hosted instances #77

Description

@khvn26

Setting FLAGSMITH_API_KEY against a self-hosted instance does nothing, and the error tells you to do exactly what you just did:

➜  dev flagsmith init --api-url https://flagsmith.example.com
➜  dev export FLAGSMITH_API_KEY=…
➜  dev flagsmith project list
Error: not logged in
Run `flagsmith login`, or set FLAGSMITH_API_KEY for non-interactive use.

Three changes to fix this:

  1. When the unscoped variable is set but ignored, say so and name the variable to use, rather than reporting not logged in.
  2. Make hintLogin name the scoped variable whenever the instance isn't the default host.
  3. Document the host-scoped form and the reason for it in the README's credentials section.

Reported by a self-hosted user in Slack, who was left with a working key and no way to use it.

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