diff options
Diffstat (limited to 'lib/api/resource_access_tokens.rb')
-rw-r--r-- | lib/api/resource_access_tokens.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/api/resource_access_tokens.rb b/lib/api/resource_access_tokens.rb index 752feb1455f..1e1b5d77cfd 100644 --- a/lib/api/resource_access_tokens.rb +++ b/lib/api/resource_access_tokens.rb @@ -153,7 +153,13 @@ module API token = find_token(resource, params[:token_id]) if resource_accessible if token - response = ::PersonalAccessTokens::RotateService.new(current_user, token).execute(declared_params) + response = if source_type == "project" + ::ProjectAccessTokens::RotateService.new(current_user, token, resource) + .execute(declared_params) + else + ::PersonalAccessTokens::RotateService.new(current_user, token) + .execute(declared_params) + end if response.success? status :ok |