From f3cd24a9f3f581488d621475e55e3a81bbd9e67c Mon Sep 17 00:00:00 2001 From: Imre Farkas Date: Thu, 8 Nov 2018 16:03:56 +0100 Subject: Display impersonation token value only after creation Since we migrated all PersonlAccessTokens to store only its hash in the DB, the token value can no longer be shown to the user. --- lib/api/users.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/api/users.rb') diff --git a/lib/api/users.rb b/lib/api/users.rb index 2a56506f3a5..b41fce76df0 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -531,7 +531,7 @@ module API desc 'Create a impersonation token. Available only for admins.' do detail 'This feature was introduced in GitLab 9.0' - success Entities::ImpersonationToken + success Entities::ImpersonationTokenWithToken end params do requires :name, type: String, desc: 'The name of the impersonation token' @@ -542,7 +542,7 @@ module API impersonation_token = finder.build(declared_params(include_missing: false)) if impersonation_token.save - present impersonation_token, with: Entities::ImpersonationToken + present impersonation_token, with: Entities::ImpersonationTokenWithToken else render_validation_error!(impersonation_token) end -- cgit v1.2.1