Skip to content

Fix OAuth authorize response type defaulting 🪿✨ - #1956

Merged
jar-stripe merged 2 commits into
masterfrom
fix/oauth-authorize-response-type
Sep 1, 2026
Merged

Fix OAuth authorize response type defaulting 🪿✨#1956
jar-stripe merged 2 commits into
masterfrom
fix/oauth-authorize-response-type

Conversation

@jar-stripe

Copy link
Copy Markdown
Contributor

Why?

Reported in #1952. OAuthService#authorize_url omits response_type=code when callers provide no value and overwrites explicit values with code. This aligns OAuthService with the legacy OAuth helper so the default is applied only when needed.

What?

  • Default response_type to code when absent or falsey.
  • Preserve an explicit response_type and add regression coverage for both behaviors.

See Also

Changelog

  • Fixes OAuthService#authorize_url to default response_type to code without overwriting an explicit value.

Committed-By-Agent: goose
Orbit-Session-Id: 38c0eb7b-df45-4b91-a889-40636e127972
Copilot AI lite review requested due to automatic review settings August 31, 2026 17:51
@jar-stripe
jar-stripe requested a review from a team as a code owner August 31, 2026 17:51
@jar-stripe
jar-stripe requested review from zacchua-stripe and removed request for a team August 31, 2026 17:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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_type via params[:response_type] ||= "code" in OAuthService#authorize_url.
  • Add regression coverage to ensure response_type=code is 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.

@jar-stripe
jar-stripe enabled auto-merge (squash) September 1, 2026 00:01
@jar-stripe
jar-stripe merged commit 339e28b into master Sep 1, 2026
16 checks passed
@jar-stripe
jar-stripe deleted the fix/oauth-authorize-response-type branch September 1, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants