diff options
author | Michael Leopard <mleopard@gitlab.com> | 2019-06-19 23:27:34 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-06-19 23:27:34 +0300 |
commit | 8cf85b4bb50d0b116cb50699831f3ec049ae4ad4 (patch) | |
tree | 9dc2a9627e70860ed4ffd8ec938f58d4c48ad15f /lib/api/users.rb | |
parent | 4a5bda06900b2b623f7f9fcdce6b36cdcf73bc51 (diff) |
Updating CE repo to include new EE users API changes
Updated users API documentation
Moved API level changes to the service level
Diffstat (limited to 'lib/api/users.rb')
-rw-r--r-- | lib/api/users.rb | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/api/users.rb b/lib/api/users.rb index 6afeebb6890..9ab5fa8d0bd 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -209,22 +209,9 @@ module API .where.not(id: user.id).count > 0 user_params = declared_params(include_missing: false) - identity_attrs = user_params.slice(:provider, :extern_uid) - - if identity_attrs.any? - identity = user.identities.find_by(provider: identity_attrs[:provider]) - - if identity - identity.update(identity_attrs) - else - identity = user.identities.build(identity_attrs) - identity.save - end - end user_params[:password_expires_at] = Time.now if user_params[:password].present? - - result = ::Users::UpdateService.new(current_user, user_params.except(:extern_uid, :provider).merge(user: user)).execute + result = ::Users::UpdateService.new(current_user, user_params.merge(user: user)).execute if result[:status] == :success present user, with: Entities::UserPublic, current_user: current_user |