FIX: Redirect to provided origin after auth (#12558)

It used to redirect to the destination_url cookie which sometimes is set
incorrectly.
This commit is contained in:
Dan Ungureanu
2021-03-31 12:23:12 +03:00
committed by GitHub
parent c847f5e8a1
commit dce48d8aa7
3 changed files with 17 additions and 1 deletions

View File

@ -34,6 +34,9 @@ class Middleware::OmniauthBypassMiddleware
# If the user is trying to reconnect to an existing account, store in session
request.session[:auth_reconnect] = !!request.params["reconnect"]
# If the client provided an origin, store in session to redirect back
request.session[:destination_url] = request.params["origin"]
end
end