Skip to content

Commit 0556777

Browse files
committed
Rubocop fixes and small code updates
1 parent 6b9aeb5 commit 0556777

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

app/controllers/api/v2/base_api_controller.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class BaseApiController < ApplicationController # rubocop:todo Style/Documentati
99
# call doorkeeper to authorize the request
1010
before_action :doorkeeper_authorize!, except: %i[heartbeat]
1111
# get details of server (e.g. DMPonline) and client app
12-
before_action :get_client_and_server_details
12+
before_action :base_response_content
1313

1414
before_action :log_access
1515

@@ -36,15 +36,17 @@ def me
3636
# define instance variable json and associated getter and setter methods
3737
attr_accessor :json
3838

39-
def get_client_and_server_details
39+
def base_response_content
4040
@application = ApplicationService.application_name
4141
@caller = request.remote_ip if @client.blank?
4242
@caller = @client.is_a?(User) ? @client.name(false) : @client.name if @client.present?
4343
end
4444

4545
def log_access
46-
Rails.logger.info "Client (OAuth) application name: #{@client.name}" if @client.present?
47-
Rails.logger.info "Client (OAuth) application uid: #{@client.uid}" if @client.present?
46+
if @client.present?
47+
Rails.logger.info "Client (OAuth) application name: #{@client.name}"
48+
Rails.logger.info "Client (OAuth) application uid: #{@client.uid}"
49+
end
4850
Rails.logger.info "Resource owner id: #{@resource_owner.id}" if @resource_owner
4951
end
5052

config/initializers/doorkeeper.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,3 @@
5858
# enable ssl requirement for redirect url
5959
force_ssl_in_redirect_uri true
6060
end
61-
end

0 commit comments

Comments
 (0)