Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorFrancisco Javier López <fjlopez@gitlab.com>2018-06-13 11:25:01 +0300
committerDouwe Maan <douwe@gitlab.com>2018-06-13 11:25:01 +0300
commitdf45623b3455193395d523bc88deee87b5f6d56f (patch)
tree410e4847b2ee01dbf60d1f0c47badd420d39957a /lib/api
parent504f3620330fa0cc8b6f3cb3f1647db2158a036f (diff)
Restoring user v3 endpoint
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/users.rb26
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