]> git.openstreetmap.org Git - rails.git/blobdiff - app/controllers/user_controller.rb
Make sure "please read the terms" error is issued in the right language
[rails.git] / app / controllers / user_controller.rb
index 25dd18f9223b905493baf91b50b1f5ecfd5568e3..72d60a307eda63e0cd9e947bf326000afb7061d6 100644 (file)
@@ -95,9 +95,9 @@ class UserController < ApplicationController
         flash[:notice] = t 'user.new.flash create success message', :email => @user.email
         Notifier.deliver_signup_confirm(@user, @user.tokens.create(:referer => params[:referer]))
         session[:token] = @user.tokens.create.token
-        redirect_to :action => 'login'
+        redirect_to :action => 'login', :referer => params[:referer]
       else
-        render :action => 'new'
+        render :action => 'new', :referer => params[:referer]
       end
     end
   end
@@ -501,9 +501,11 @@ private
   # Choose the layout to use. See
   # https://rails.lighthouseapp.com/projects/8994/tickets/5371-layout-with-onlyexcept-options-makes-other-actions-render-without-layouts
   def choose_layout
+    oauth_url = url_for(:controller => :oauth, :action => :oauthorize, :only_path => true)
+
     if [ 'api_details' ].include? action_name
       nil
-    elsif params[:referer] == url_for(:controller => :oauth, :action => :oauthorize, :only_path => true)
+    elsif params[:referer] and URI.parse(params[:referer]).path == oauth_url
       'slim'
     else
       'site'