X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/b108476b9e875376c89ba4d021395d9493d87bee..b34b89845122aff079af055f5adfc909c1e6ac9e:/app/controllers/user_controller.rb diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 86b715154..bea700331 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -29,7 +29,7 @@ class UserController < ApplicationController if @user.save flash[:notice] = t 'user.new.flash create success message' - Notifier.deliver_signup_confirm(@user, @user.tokens.create) + Notifier.deliver_signup_confirm(@user, @user.tokens.create(:referer => params[:referer])) redirect_to :action => 'login' else render :action => 'new' @@ -198,10 +198,15 @@ class UserController < ApplicationController @user.active = true @user.email_valid = true @user.save! + referer = token.referer token.destroy flash[:notice] = t 'user.confirm.success' session[:user] = @user.id - redirect_to :action => 'account', :display_name => @user.display_name + unless referer.nil? + redirect_to referer + else + redirect_to :action => 'account', :display_name => @user.display_name + end else @notice = t 'user.confirm.failure' end