Repository navigation
OAuth Allow/Deny: return page instead of a 302 (fixes Gemini) - #38
Conversation
…ini's redirect chain broke on form-action)
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Build and verify the browser return crates/outer/src/auth/oauth.rs, crates/outer/src/auth/pages.rs, crates/outer/src/auth/tests.rs |
The authorization handler renders a return page instead of sending a 302 response. The page includes a zero-delay meta refresh, the destination host, and a fallback link. Allow and Deny tests extract query parameters from the response body. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Sequence Diagram(s)
sequenceDiagram
participant OAuthHandler
participant ReturnPage
participant Browser
participant Client
OAuthHandler->>ReturnPage: Render authorization URL and display host
ReturnPage-->>Browser: Return HTTP 200 HTML with meta refresh
Browser->>Client: Navigate to authorization URL
Possibly related PRs
- ryuzcorp/outer#16: Adds the consent-page CSP rule for the client redirect origin, which relates to the OAuth browser return flow.
Merge Risk: 
Minimal · up to 0a928
-
The OAuth browser handoff preserves the redirect target without an established merge-blocking risk.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed -
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
Owner: Gemini's custom MCP OAuth got stuck on the consent page after Allow. Server side the flow had succeeded (the pending request had an account and a code), so the browser dropped the redirect.
Cause: the Allow/Deny form answered with a 302 to the client. Browsers apply CSP
form-actionto every hop of a form submission's redirect chain; the consent page allows'self'plus the request's redirect origin (#16, for Perplexity), but Gemini's redirect URI (https://oauth-redirect.googleusercontent.com/r/...) bounces on to other Google origins, whichform-actionblocks.Fix: Allow/Deny now answers 200 with a small "Returning to …" page that navigates by
<meta http-equiv="refresh" content="0;url=…">(a fresh navigation thatform-actiondoesn't govern) plus a visible link as fallback. The URL is unchanged:codeorerror=access_denied,state,iss. Tests read the target from the page instead ofLocation. 438 pass.Live as
outer:0a92898; the owner re-tests Gemini.Summary by CodeRabbit
stateandisswhen present.