Commit 1b0198f1 authored by Florian Unglaub's avatar Florian Unglaub

save newly created users directly in the model

parent 6d6c7a17
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment