From: Milan Cvetkovic Date: Mon, 6 Nov 2023 13:16:49 +0000 (+0000) Subject: Welcome screen displays 'Continue with authorization' X-Git-Tag: live~884^2~3 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/60c885d071de5db26de79b1d80fd1244cf2d8832?hp=26f12ef11a43a83ad08a59742f15027417b2c968 Welcome screen displays 'Continue with authorization' do not hide notes --- diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 36c9f4e22..6db39d2d0 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -199,8 +199,9 @@ class UsersController < ApplicationController referer = welcome_path + uri = URI(session[:referer]) if session[:referer].present? + begin - uri = URI(session[:referer]) %r{map=(.*)/(.*)/(.*)}.match(uri.fragment) do |m| editor = Rack::Utils.parse_query(uri.query).slice("editor") referer = welcome_path({ "zoom" => m[1], @@ -212,6 +213,7 @@ class UsersController < ApplicationController end if current_user.status == "active" + referer = welcome_path({"oauth_return_url" => uri.to_s}) if uri&.path == oauth_authorization_path session[:referer] = referer successful_login(current_user) else diff --git a/app/views/site/welcome.html.erb b/app/views/site/welcome.html.erb index b05620f59..8ec32ea9c 100644 --- a/app/views/site/welcome.html.erb +++ b/app/views/site/welcome.html.erb @@ -60,7 +60,13 @@
-

<%= t ".start_mapping" %>

+

+<% if params[:oauth_return_url] %> + <%= t ".continue_authorization" %> +<% else %> + <%= t ".start_mapping" %> +<% end %> +

diff --git a/config/locales/en.yml b/config/locales/en.yml index 1a41dcce8..f98a78a31 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2382,6 +2382,7 @@ en: automated_edits: Automated Edits automated_edits_url: https://wiki.openstreetmap.org/wiki/Automated_Edits_code_of_conduct start_mapping: Start Mapping + continue_authorization: Continue Authorization add_a_note: title: No Time To Edit? Add a Note! para_1: |