Skip to content
Snippets Groups Projects
Commit 8f4e3811 authored by David Zumbrunnen's avatar David Zumbrunnen
Browse files

Fixes NoMethodError with Redmine 3.x

parent 6b2deedb
No related branches found
No related tags found
No related merge requests found
...@@ -38,7 +38,7 @@ class RedmineOauthController < AccountController ...@@ -38,7 +38,7 @@ class RedmineOauthController < AccountController
def try_to_login info def try_to_login info
params[:back_url] = session[:back_url] params[:back_url] = session[:back_url]
session.delete(:back_url) session.delete(:back_url)
user = User.find_or_initialize_by_mail(info["email"]) user = User.joins(:email_addresses).where(:email_addresses => { :address => info["email"] }).first_or_create
if user.new_record? if user.new_record?
# Self-registration off # Self-registration off
redirect_to(home_url) && return unless Setting.self_registration? redirect_to(home_url) && return unless Setting.self_registration?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment