Skip to content

Commit 8ae4b5d

Browse files
committed
Fix for heartbeat endpoint
1 parent 0556777 commit 8ae4b5d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

app/controllers/api/v2/base_api_controller.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,17 @@ def me
3636
# define instance variable json and associated getter and setter methods
3737
attr_accessor :json
3838

39+
# rubocop:disable Metrics/AbcSize
3940
def base_response_content
4041
@application = ApplicationService.application_name
4142
@caller = request.remote_ip if @client.blank?
4243
@caller = @client.is_a?(User) ? @client.name(false) : @client.name if @client.present?
44+
@scopes = doorkeeper_token.scopes.to_a if doorkeeper_token
45+
return unless doorkeeper_token&.resource_owner_id
46+
47+
@resource_owner = User.find(doorkeeper_token.resource_owner_id)
4348
end
49+
# rubocop:enable Metrics/AbcSize
4450

4551
def log_access
4652
if @client.present?

app/views/api/v2/_standard_response.json.jbuilder

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ paginator = Api::V2::PaginationPresenter.new(current_url: request.path,
1212
json.prettify!
1313
json.ignore_nil!
1414

15-
json.server @server
15+
json.application @application
1616
json.source "#{request.method} #{request.path}"
1717
json.time Time.now.to_formatted_s(:iso8601)
18-
json.client @client.name if @client.present?
18+
json.caller @caller
1919
json.code response.status
2020
json.message Rack::Utils::HTTP_STATUS_CODES[response.status]
2121

0 commit comments

Comments
 (0)