docs(toolbar): note that authorized URLs must match the site origin including the port#16479
Open
singhvishalkr wants to merge 1 commit intoPostHog:masterfrom
Open
Conversation
…ncluding the port Adds a note under 'How to launch the toolbar' and a troubleshooting entry explaining that the authorized URL's origin (protocol + host + port) must match the site's origin exactly. A missing or extra port is a common silent cause of the toolbar not appearing. Closes PostHog#9789.
5d0480b to
599f513
Compare
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.
Problem
Users who add an entry to "Authorized URLs for Toolbar" that does not match their site's actual origin (specifically, the port) often see the toolbar silently fail to load. This has tripped up at least one user for ~1 hour of debugging (see #9789).
Looking at
checkUrlIsAuthorized, matching usesparsedUrl.protocol + '//' + parsedUrl.host, andURL.hostincludes the port when one is present. Sohttp://localhostandhttp://localhost:3000are not a match. The previous docs did not call this out.Fix
Adds two pieces of guidance to
contents/docs/toolbar/index.mdx:#### 3. The authorized URL does not match your site's origin (including port)) that lists the three most common mismatch shapes (missing port, explicit default port like:443, trailing path/query).No behaviour changes -- docs only.
Closes
Closes #9789.
How I tested
authorizedUrlListLogic.tsto confirm origin matching usesprotocol + host(host includes port).####heading sit in the expected positions within the toolbar page.