# Description 

- When users sign up through an OAuth2 authorization flow and click 
"Resend confirmation email", the OAuth referer information is lost. 
The resent confirmation email does NOT contain the referer parameter with the 
oauth_return_url, causing the "Continue authorization" button to 
disappear from the welcome page after email confirmation.

- Note : After signup if user doesnt click on "resend confirmation" , 
the initial confirmation link which was sent to email properly redirects to 
welcome page with "Continue authorization" , the above issue occurs 
only when user clicks "Resend confirmation mail"

Related to #6699 

### Fix 
- Store referer in session during user signup
- Pass stored referer when resending confirmation email
- Include referer in redirect after resending confirmation

This ensures that users who sign up via OAuth2 and click 'Resend 
confirmation email' will still see the 'Continue authorization' 
button on the welcome page after confirming their account.

Added unit tests:
- test_confirm_success_with_oauth_referer: Verifies initial signup confirmation 
preserves OAuth referer
- test_confirm_resend_preserves_oauth_referer: Verifies resending confirmation 
also preserves OAuth referer (this test fails without the fix, proving the bug 
exists)

<!--
Please read the contributing guidelines before making a PR:
  
https://github.com/openstreetmap/openstreetmap-website/blob/master/CONTRIBUTING.md

Pay particular attention to the section on how to present PRs:
  
https://github.com/openstreetmap/openstreetmap-website/blob/master/CONTRIBUTING.md#pull-requests
-->

You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/6714

-- Commit Summary --

  * Fix: Preserve OAuth referer when resending confirmation email

-- File Changes --

    M app/controllers/confirmations_controller.rb (5)
    M app/controllers/users_controller.rb (1)
    M test/controllers/confirmations_controller_test.rb (59)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/6714.patch
https://github.com/openstreetmap/openstreetmap-website/pull/6714.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6714
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to