save newly created users directly in the model
This commit is contained in:
parent
6d6c7a17ea
commit
1b0198f1d3
|
@ -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
|
||||
|
|
|
@ -114,6 +114,8 @@ class User < ActiveRecord::Base
|
|||
)
|
||||
|
||||
@user.blocked = true if Gitlab.config.omniauth.block_auto_created_users
|
||||
@user.save!
|
||||
|
||||
@user
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue