diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2018-06-13 08:25:01 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-06-13 08:25:01 +0000 |
commit | df45623b3455193395d523bc88deee87b5f6d56f (patch) | |
tree | 410e4847b2ee01dbf60d1f0c47badd420d39957a /lib | |
parent | 504f3620330fa0cc8b6f3cb3f1647db2158a036f (diff) | |
download | gitlab-ce-df45623b3455193395d523bc88deee87b5f6d56f.tar.gz |
Restoring user v3 endpoint
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/users.rb | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/lib/api/users.rb b/lib/api/users.rb index 14b8a796c8e..e8df2c5a74a 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -531,18 +531,22 @@ module API authenticate! end - desc 'Get the currently authenticated user' do - success Entities::UserPublic - end - get do - entity = - if current_user.admin? - Entities::UserWithAdmin - else - Entities::UserPublic - end + # Enabling /user endpoint for the v3 version to allow oauth + # authentication through this endpoint. + version %w(v3 v4), using: :path do + desc 'Get the currently authenticated user' do + success Entities::UserPublic + end + get do + entity = + if current_user.admin? + Entities::UserWithAdmin + else + Entities::UserPublic + end - present current_user, with: entity + present current_user, with: entity + end end desc "Get the currently authenticated user's SSH keys" do |