Commit 2e8b0fa5cf9e70c55bd1dbb254db3f9aa45b23e9
1 parent
6fff92e9
Exists in
master
and in
4 other branches
Oauth users and users created by admin should be confirmed immediatly
Showing
3 changed files
with
6 additions
and
0 deletions
Show diff stats
app/controllers/admin/users_controller.rb
@@ -47,6 +47,7 @@ class Admin::UsersController < Admin::ApplicationController | @@ -47,6 +47,7 @@ class Admin::UsersController < Admin::ApplicationController | ||
47 | @user = User.build_user(params[:user].merge(opts), as: :admin) | 47 | @user = User.build_user(params[:user].merge(opts), as: :admin) |
48 | @user.admin = (admin && admin.to_i > 0) | 48 | @user.admin = (admin && admin.to_i > 0) |
49 | @user.created_by_id = current_user.id | 49 | @user.created_by_id = current_user.id |
50 | + @user.confirm! | ||
50 | 51 | ||
51 | respond_to do |format| | 52 | respond_to do |format| |
52 | if @user.save | 53 | if @user.save |
lib/gitlab/oauth/user.rb
@@ -29,6 +29,7 @@ module Gitlab | @@ -29,6 +29,7 @@ module Gitlab | ||
29 | 29 | ||
30 | user = model.build_user(opts, as: :admin) | 30 | user = model.build_user(opts, as: :admin) |
31 | user.save! | 31 | user.save! |
32 | + user.confirm! | ||
32 | log.info "(OAuth) Creating user #{email} from login with extern_uid => #{uid}" | 33 | log.info "(OAuth) Creating user #{email} from login with extern_uid => #{uid}" |
33 | 34 | ||
34 | if Gitlab.config.omniauth['block_auto_created_users'] && !ldap? | 35 | if Gitlab.config.omniauth['block_auto_created_users'] && !ldap? |
spec/factories.rb