Skip to content

fix(auth): name HEYGEN_CONFIG_DIR when there is no home directory for a login - #585

Merged
somanshreddy merged 1 commit into
mainfrom
11-16-no_home_auth_hint
Nov 16, 2026
Merged

somanshreddy merged 1 commit into
mainfrom
11-16-no_home_auth_hint

Conversation

@somanshreddy

Copy link
Copy Markdown
Collaborator

Scope

Surfaces: CLI | Module: Auth

Summary

Follow-up to #579. With no home directory, the "no API key found" error now leads with the two fixes that work there, instead of only suggesting heygen auth login, which cannot save a login in that environment. Live on the next release.

How it works

  • When HOME is unset, empty or relative and HEYGEN_CONFIG_DIR is not set, the hint starts with: set HEYGEN_API_KEY, or set HEYGEN_CONFIG_DIR to a folder before running heygen auth login. The usual guidance follows.
  • With a home directory, the hint is unchanged.

Testing

  • A new test checks both cases: the extra line appears only with no config directory. Removing the check makes it fail.
  • Ran a built binary with an empty environment and saw the new hint on heygen video list.

🤖 Generated with Claude Code

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at e8ad09e. Approving.

  • missingCredentialsHint tests the same condition that paths.ConfigDir returns ErrNoConfigDir for: HEYGEN_CONFIG_DIR unset, and no absolute home directory. It's used at the only place that enriches the "no API key found" error (context.go:124). The other authGuidance users (auth login, auth status, group help) are unchanged, which is right.
  • The test is meaningful. authGuidance itself never mentions HEYGEN_CONFIG_DIR, so the Contains check fails if the hint always returns authGuidance. The second half pins the normal case to authGuidance alone.
  • I ran it end to end. A build of this head, run with env -i PATH=/usr/bin:/bin heygen video list, prints auth_error with the new two-line lead followed by the unchanged guidance.

Go 1.26.11: the auth and no-config-dir tests pass.

Review by Rames

@somanshreddy
somanshreddy force-pushed the 11-16-no_home_auth_hint branch from e8ad09e to 6e67244 Compare November 16, 2026 04:45
@somanshreddy
somanshreddy merged commit dbb9f4e into main Nov 16, 2026
12 checks passed
@somanshreddy
somanshreddy deleted the 11-16-no_home_auth_hint branch November 16, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants