X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/124ec2e9d560e0df291e5a8e5aa67ef5db2f5d46..1d49b0d71df85ca7f6d049c2ccd2bed0999f2a79:/app/controllers/user_controller.rb diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 430051c17..82373c90a 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -268,7 +268,7 @@ class UserController < ApplicationController def logout @title = t "user.logout.title" - if params[:session] == request.session_options[:id] + if params[:session] == session.id if session[:token] token = UserToken.find_by(:token => session[:token]) token.destroy if token @@ -496,7 +496,7 @@ class UserController < ApplicationController ## # omniauth success callback def auth_success - auth_info = env["omniauth.auth"] + auth_info = request.env["omniauth.auth"] provider = auth_info[:provider] uid = auth_info[:uid] @@ -545,7 +545,7 @@ class UserController < ApplicationController when "pending" then unconfirmed_login(user) when "active", "confirmed" then - successful_login(user, env["omniauth.params"]["referer"]) + successful_login(user, request.env["omniauth.params"]["referer"]) when "suspended" then failed_login t("user.login.account is suspended", :webmaster => "mailto:#{SUPPORT_EMAIL}") else @@ -725,8 +725,8 @@ class UserController < ApplicationController # Ignore errors sending email end else - @user.errors.set(:new_email, @user.errors.get(:email)) - @user.errors.set(:email, []) + @user.errors.add(:new_email, @user.errors[:email]) + @user.errors.add(:email, []) end user.restore_email!