Fix OAuth authorize response type defaulting 🪿✨ - #1956
Merged
Conversation
Committed-By-Agent: goose Orbit-Session-Id: 38c0eb7b-df45-4b91-a889-40636e127972
jar-stripe
requested review from
zacchua-stripe
and removed request for
a team
August 31, 2026 17:51
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The fix directly addresses the reported bug and includes targeted regression tests covering both the defaulting and non-overwrite behaviors.
Pull request overview
Fixes Stripe::OAuthService#authorize_url so response_type defaults to "code" only when absent/falsey, matching the legacy OAuth helper behavior and preventing accidental overwrites of explicitly provided values.
Changes:
- Default
response_typeviaparams[:response_type] ||= "code"inOAuthService#authorize_url. - Add regression coverage to ensure
response_type=codeis present when omitted. - Add regression coverage to ensure an explicit
response_type(e.g.,"token") is preserved.
File summaries
| File | Description |
|---|---|
| lib/stripe/services/oauth_service.rb | Fixes defaulting logic for response_type without overwriting explicit caller-provided values. |
| test/stripe/oauth_service_test.rb | Adds assertions for default response_type and preservation of explicit response_type. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
xavdid
approved these changes
Aug 31, 2026
jar-stripe
enabled auto-merge (squash)
September 1, 2026 00:01
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.
Why?
Reported in #1952.
OAuthService#authorize_urlomitsresponse_type=codewhen callers provide no value and overwrites explicit values withcode. This alignsOAuthServicewith the legacy OAuth helper so the default is applied only when needed.What?
response_typetocodewhen absent or falsey.response_typeand add regression coverage for both behaviors.See Also
Changelog
OAuthService#authorize_urlto defaultresponse_typetocodewithout overwriting an explicit value.