Skip to content

Fix OAuth authorization resume after sign-up#17

Merged
AliOsm merged 1 commit into
mainfrom
mcp-server
Jul 10, 2026
Merged

Fix OAuth authorization resume after sign-up#17
AliOsm merged 1 commit into
mainfrom
mcp-server

Conversation

@AliOsm

@AliOsm AliOsm commented Jul 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • resume the saved OAuth authorization URL after a user creates an account
  • retain the existing dashboard destination for ordinary signups with no saved return path
  • add an integration test covering authorize request, signup, exact consent URL restoration, and consent rendering
  • update the Doorkeeper authentication comment to describe both sign-in and sign-up resume behavior

Root cause

start_new_session_for correctly preserved session[:return_to_after_authenticating] across session rotation, but UsersController#create always redirected successful registrations to the dashboard. Unlike sign-in, signup never consumed the saved OAuth URL, so a new user connecting an MCP client left the client waiting for an authorization callback.

User impact

A first-time PasteHTML user can now choose Sign up during a Claude, Codex, or other MCP OAuth flow and return directly to the consent screen. Existing signup behavior remains unchanged outside an interrupted authentication flow.

Validation

  • focused OAuth and authentication suites: 33 runs, 228 assertions, 0 failures, 0 errors
  • CI=1 bundle exec rails test: 440 runs, 2,053 assertions, 0 failures, 0 errors
  • bundle exec rubocop: 128 files, no offenses
  • bundle exec brakeman --no-pager: zero warnings
  • RAILS_ENV=test bundle exec rails zeitwerk:check: all good

@AliOsm AliOsm marked this pull request as ready for review July 10, 2026 20:34
@AliOsm AliOsm merged commit 2c4f908 into main Jul 10, 2026
3 checks passed
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.

1 participant