diff options
-rw-r--r-- | app/controllers/admin/users_controller.rb | 1 | ||||
-rw-r--r-- | lib/gitlab/oauth/user.rb | 1 | ||||
-rw-r--r-- | spec/factories.rb | 4 |
3 files changed, 6 insertions, 0 deletions
diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index 70bbe306562..076c5f0ba58 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -47,6 +47,7 @@ class Admin::UsersController < Admin::ApplicationController @user = User.build_user(params[:user].merge(opts), as: :admin) @user.admin = (admin && admin.to_i > 0) @user.created_by_id = current_user.id + @user.confirm! respond_to do |format| if @user.save diff --git a/lib/gitlab/oauth/user.rb b/lib/gitlab/oauth/user.rb index 1b32b99f4ba..ea9badba2c3 100644 --- a/lib/gitlab/oauth/user.rb +++ b/lib/gitlab/oauth/user.rb @@ -29,6 +29,7 @@ module Gitlab user = model.build_user(opts, as: :admin) user.save! + user.confirm! log.info "(OAuth) Creating user #{email} from login with extern_uid => #{uid}" if Gitlab.config.omniauth['block_auto_created_users'] && !ldap? diff --git a/spec/factories.rb b/spec/factories.rb index 56561fe4595..91ef5086a9e 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -23,6 +23,10 @@ FactoryGirl.define do end factory :admin, traits: [:admin] + + after :create do |u| + u.confirm! + end end factory :project do |