fix(hub): print direct local login link on startup#363
Open
Sun-sunshine06 wants to merge 1 commit intotiann:mainfrom
Open
fix(hub): print direct local login link on startup#363Sun-sunshine06 wants to merge 1 commit intotiann:mainfrom
Sun-sunshine06 wants to merge 1 commit intotiann:mainfrom
Conversation
There was a problem hiding this comment.
Findings
- [Major] Startup log now prints tokenized login URL every run;
CLI_API_TOKENends up in logs even when sourced from env/file. Evidencehub/src/index.ts:232
Suggested fix:if (config.cliApiTokenIsNew || process.env.HAPI_LOG_TOKENS === 'true') { console.log('[Web] Login: ' + localDirectAccessUrl) }
Summary
- Review mode: initial. 1 major issue: token logged each startup; gate behind opt-in or only on new token.
Testing
- Not run (automation)
| console.log('[Web] Hub listening on :' + config.listenPort) | ||
| console.log('[Web] Local: http://localhost:' + config.listenPort) | ||
| console.log('[Web] Local: ' + localUrl) | ||
| console.log('[Web] Login: ' + localDirectAccessUrl) |
There was a problem hiding this comment.
[MAJOR] Startup log prints tokenized login URL every run; CLI_API_TOKEN ends up in logs even when sourced from env/file. Evidence hub/src/index.ts:232.
Suggested fix:
if (config.cliApiTokenIsNew || process.env.HAPI_LOG_TOKENS === 'true') {
console.log('[Web] Login: ' + localDirectAccessUrl)
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Print a direct local login link when HAPI Hub starts, and update CLI guidance to point users to that startup output.
Why
When HAPI Hub is opened remotely or through a browser on another device, it can be inconvenient to manually find the access token in local config files.
A startup login URL makes first-time access much easier.
Changes
Notes
Testing
cd hub && bun test src/utils/directAccess.test.tsbun typecheck