fix(auth): harden OAuth callback flow and add per-app redirect URI co…#64
Merged
santiagomed merged 1 commit intoxdevplatform:mainfrom Apr 20, 2026
Conversation
This was referenced Apr 20, 2026
santiagomed
approved these changes
Apr 20, 2026
Collaborator
santiagomed
left a comment
There was a problem hiding this comment.
Thanks for the thorough fix, @robert-hoffmann!
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
This PR improves
xurl's OAuth and app configuration flow in a few related areas:localhostresolves inconsistently across loopback families/2/users/meis unreliableredirect_urisupport in~/.xurl, withREDIRECT_URIenv override precedenceProblem
I hit a few issues while trying to use OAuth2 locally:
http://localhost:8080/callback, but depending on howlocalhostresolved, the browser callback could miss the listener unless I manually changed it to127.0.0.1/2/users/medid not reliably return username dataREDIRECT_URIcould only be configured via environment variable, even though app credentials and tokens already live in~/.xurlSeparately, after the local callback flow was fixed, I also confirmed a live X platform issue that produced
client-forbidden/client-not-enrolledfor reads until the app was moved to thePay-per-usepackage andProductionenvironment. I documented that in the repo docs/changelog as platform troubleshooting guidance, not as anxurlcode change.Changes
OAuth callback flow
localhost, listen on both:127.0.0.1::1http.DefaultServeMuxusage with a dedicated local muxOAuth2 resilience
/2/users/mefails--usernamelookup when/2/users/meis unavailableBearerheaderRedirect URI config
redirect_urisupport to~/.xurlREDIRECT_URIenv varredirect_urixurl auth apps redirect-uri get [NAME]xurl auth apps redirect-uri set NAME URIxurl auth apps update NAME --redirect-uri URI--redirect-urionxurl auth apps addDocs and tests
SKILL.mdfor:Validation
Ran:
go test ./...