Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/omniauth_callbacks_controller.rb1
-rw-r--r--app/models/user.rb2
2 files changed, 2 insertions, 1 deletions
diff --git a/app/controllers/omniauth_callbacks_controller.rb b/app/controllers/omniauth_callbacks_controller.rb
index 248a75a88cb..3be285ba1f6 100644
--- a/app/controllers/omniauth_callbacks_controller.rb
+++ b/app/controllers/omniauth_callbacks_controller.rb
@@ -39,7 +39,6 @@ class OmniauthCallbacksController < Devise::OmniauthCallbacksController
redirect_to profile_path
else
@user = User.find_or_new_for_omniauth(oauth)
- @user.save! if @user.try('new_record?')
if @user
sign_in_and_redirect @user
diff --git a/app/models/user.rb b/app/models/user.rb
index b956d4ed433..0d45b6e537a 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -114,6 +114,8 @@ class User < ActiveRecord::Base
)
@user.blocked = true if Gitlab.config.omniauth.block_auto_created_users
+ @user.save!
+
@user
end
end