[openstreetmap/openstreetmap-website] Welcome screen shows "Continue with authorization" when OSM account created from authorization flow (PR #4329)

Milan Cvetkovic notifications at github.com
Wed Nov 15 10:20:11 UTC 2023


@milan-cvetkovic commented on this pull request.



> @@ -317,6 +305,24 @@ def auth_failure
 
   private
 
+  def welcome_options
+    uri = URI(session[:referer]) if session[:referer].present?
+    welcome_options = {}
+    welcome_options["oauth_return_url"] = session[:referer] if uri&.path == oauth_authorization_path
+
+    begin
+      %r{map=(.*)/(.*)/(.*)}.match(uri.fragment) do |m|
+        editor = Rack::Utils.parse_query(uri.query).slice("editor")
+        welcome_options = { "zoom" => m[1],
+                            "lat" => m[2],
+                            "lon" => m[3] }.merge(editor).merge(welcome_options)

I am not too sure about this.

What is the use case that would have a fragment in `session[:referrer]`?

I wasn't able to reproduce it...

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

Message ID: <openstreetmap/openstreetmap-website/pull/4329/review/1731693697 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20231115/a8b1071c/attachment.htm>


More information about the rails-dev mailing list