X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2a3bc0a38789b29b8798eafd80fc4fb77c5c7957..250a068b066c8968047ed90c2de64a47f9301c7d:/app/controllers/user_controller.rb diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index dfacb9d5a..fdef4ea04 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -88,12 +88,19 @@ class UserController < ApplicationController if @user.save flash[:piwik_goal] = PIWIK_SIGNUP_GOAL if defined?(PIWIK_SIGNUP_GOAL) + begin + referer_params = Rack::Utils.parse_query(URI(session[:referer]).query) + referer = welcome_path(referer_params.slice(:lat, :lon, :zoom, :editor)) + rescue + referer = welcome_path + end + if @user.status == "active" - session[:referer] = welcome_path + session[:referer] = referer successful_login(@user) else session[:token] = @user.tokens.create.token - Notifier.signup_confirm(@user, @user.tokens.create(:referer => welcome_path)).deliver + Notifier.signup_confirm(@user, @user.tokens.create(:referer => referer)).deliver redirect_to :action => 'confirm', :display_name => @user.display_name end else