Commit 4629cc44d6b7fa7ebdec8ce47bb0825e255d7763
1 parent
dddb5b5d
Exists in
master
and in
4 other branches
fix mass assignment error in create_from_omniauth after a6a229a
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
lib/gitlab/auth.rb
| @@ -30,7 +30,7 @@ module Gitlab | @@ -30,7 +30,7 @@ module Gitlab | ||
| 30 | log.info "#{ldap_prefix}Creating user from #{provider} login"\ | 30 | log.info "#{ldap_prefix}Creating user from #{provider} login"\ |
| 31 | " {uid => #{uid}, name => #{name}, email => #{email}}" | 31 | " {uid => #{uid}, name => #{name}, email => #{email}}" |
| 32 | password = Devise.friendly_token[0, 8].downcase | 32 | password = Devise.friendly_token[0, 8].downcase |
| 33 | - @user = User.new( | 33 | + @user = User.new({ |
| 34 | extern_uid: uid, | 34 | extern_uid: uid, |
| 35 | provider: provider, | 35 | provider: provider, |
| 36 | name: name, | 36 | name: name, |
| @@ -38,7 +38,7 @@ module Gitlab | @@ -38,7 +38,7 @@ module Gitlab | ||
| 38 | password: password, | 38 | password: password, |
| 39 | password_confirmation: password, | 39 | password_confirmation: password, |
| 40 | projects_limit: Gitlab.config.default_projects_limit, | 40 | projects_limit: Gitlab.config.default_projects_limit, |
| 41 | - ) | 41 | + }, as: :admin) |
| 42 | if Gitlab.config.omniauth['block_auto_created_users'] && !ldap | 42 | if Gitlab.config.omniauth['block_auto_created_users'] && !ldap |
| 43 | @user.blocked = true | 43 | @user.blocked = true |
| 44 | end | 44 | end |