Repository navigation
fix(auth): bind callback server to loopback - #13
Open
Kamilgulzar wants to merge 1 commit into
Open
Kamilgulzar wants to merge 1 commit into
Kamilgulzar wants to merge 1 commit into
Conversation
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
The authentication callback server currently binds to every network interface when
vitrin loginstarts. A request to the machine's LAN address can therefore supply a token to the CLI session during authentication.Bind the shared authentication listener explicitly to
127.0.0.1, keeping callbacks local for both the CLI and TUI login flows. Add standalone regression tests that exercise the real HTTP listener without opening a browser or writing credentials.Fixes #10.
Validation
Tested on Windows with Node.js 22.13.1:
npm run build.git diff --checkpass.Run the standalone regression tests after building (Node.js 22.3+ required for experimental module mocking):
The network test requires a non-loopback IPv4 interface; it reports a skip when none is available. The default-port test requires port 4444 to be free. These tests run separately from the existing Jest suite.
Existing check failures and limits
npm test: all five existing suites fail before executing tests because Jest parsesimport.metaintests/setup.tsoutside an ES module.npm run lint: ESLint 9 cannot find a flat configuration; the repository provides.eslintrc.js.