Repository navigation
Accept the null Origin in CLI browser login loopback - #1520
Merged
Merged
Conversation
Browsers send Origin: null when an HTTPS dashboard page posts a form to the http://127.0.0.1 loopback, so amcp login --browser always answered 'Unexpected origin' against Cloud. Accept null, keep refusing any other foreign origin; the 192-bit state remains the binding check. Bump the CLI to 0.1.2.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
amcp login --browser --url https://cloud.anythingmcp.comnever completed: after Authorize, the loopback page showed "Unexpected origin. Nothing was saved."Cause: Chrome sends
Origin: nullwhen an HTTPS page (the/cli-authdashboard page) posts a form to thehttp://127.0.0.1loopback, a secure-to-insecure navigation. Verified with a probe server: the request arrived withorigin: "null"andsec-fetch-site: cross-site. The CLI accepted only the exact instance origin, so it rejected every Cloud (HTTPS) login.Fix: the loopback server also accepts the opaque
nullorigin. It still refuses a POST that names any other origin. The 192-bitstatestays the check that binds the browser POST to this CLI run. The CLI version goes to 0.1.2, so the fix can be published.Deployment modes
Tests
packages/cli:npm test. Result: 21 passed, 2 skipped (fish is not installed), 0 failed. New cases: a POST withOrigin: nulldelivers the key, and a foreign-origin POST gets 403 without ending the login.XDG_CONFIG_HOME=<tmp> AMCP_NO_BROWSER=1 node dist/index.js login --browser --url https://cloud.anythingmcp.com, then Authorize in Chrome. Result: "Logged in to https://cloud.anythingmcp.com (management, profile: default)", andamcp api GET /api/users/mereturned the user.