Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set user_return_to in GET /maker/google_oauth_confirm_login #39949

Merged
merged 2 commits into from
Apr 12, 2021

Conversation

maddiedierker
Copy link
Contributor

@maddiedierker maddiedierker commented Apr 7, 2021

This bug came up while investigating a different ticket -- STAR-1496 (using Google OAuth from the Maker App fails for users with unmigrated accounts).

Local repro steps (these don't repro on production because the bug hadn't been released yet):

  1. Click “log in with google” in the Maker App
  2. Click “confirm” from the browser tab that opens after step 1
  3. Go through the Google OAuth process

Expected: the browser redirects to /maker/display_google_oauth_code with the “magic code” to copy-paste back into the Maker App
Actual: the browser redirects to /home

This was happening because in browser/#76, we changed the "Login with Google" route in the Maker App:

  • old route: GET /users/sign_in?user_return_to=/maker/display_google_oauth_code
  • new route: GET /maker/google_oauth_confirm_login?user_return_to=/maker/display_google_oauth_code

This change was intentional, but broke the user_return_to feature because the old route set session[:user_return_to], but the new route didn't. Now, session[:user_return_to] will be set in the new route.

Testing story

Added an integration test for this scenario.

@maddiedierker maddiedierker requested a review from a team April 7, 2021 17:10
Copy link

@epeach epeach left a comment

Choose a reason for hiding this comment

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

Good catch on this before release!

@maddiedierker maddiedierker merged commit 8e8b2c3 into staging Apr 12, 2021
@maddiedierker maddiedierker deleted the maker-google-oauth branch April 12, 2021 18:43
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.

None yet

2 participants