fix(web): portless dev auth redirects and session cookies#981
Conversation
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-app | 53ae4af | Commit Preview URL Branch Preview URL |
May 20 2026, 11:40 PM |
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
supermemory-mcp | 53ae4af | May 20 2026, 11:39 PM |
How to use the Graphite Merge QueueAdd the label Main to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
|
Claude finished @MaheshtheDev's task in 1m 1s —— View job Re-reviewing PR after updates
All three issues from vorflux's previous review have been addressed:
Submitted a clean review (10/10). This is ready to ship. |
There was a problem hiding this comment.
Overview: This PR fixes OAuth authentication in portless/worktree dev environments by reconstructing public URLs from forwarded headers and supporting dev-prefixed session cookies.
Issues found: None — this looks good to ship.
The implementation is clean:
getPublicRequestUrlcorrectly handlesx-forwarded-hostandx-forwarded-protoheaders with sensible fallbacks toPORTLESS_URLenv varresolveAuthRedirectUrlproperly remaps localhost redirect URLs (from the API) back to the actual public origin, which is the right fix for dev proxy environments- The middleware now checks both production and dev session cookies via
getAuthSessionCookie, and constructs redirect URLs using the public-facing URL rather than the internal request URL - Variable shadowing bug in the original middleware (reusing
urlfor the login redirect) is fixed with proper naming (loginUrl)
Score: 10/10
There was a problem hiding this comment.
Overview: This PR fixes OAuth authentication in portless/worktree dev environments by reconstructing public URLs from forwarded headers and supporting dev-prefixed session cookies.
Issues found: None — all issues from the previous review have been addressed:
- ✅
getPublicRequestUrlnow uses||instead of??for the protocol fallback, properly handling emptyx-forwarded-protoheaders - ✅
PROXY_LOCAL_HOSTSnow includes::1(IPv6 loopback) - ✅
resolveAuthRedirectUrlvalidates the target origin before returning, preventing open redirects — non-localhost URLs must match the current origin or fall back to the origin root
The implementation is clean and secure.
Score: 10/10
Merge activity
|
Middleware now reconstructs public URLs from portless forwarded headers and recognizes better-auth-dev session cookies so OAuth sign-in works with local API + worktree dev URLs.
46a9498 to
53ae4af
Compare

Middleware now reconstructs public URLs from portless forwarded headers and recognizes better-auth-dev session cookies so OAuth sign-in works with local API + worktree dev URLs.