mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-18 23:21:30 +08:00
20 lines
422 B
Ruby
20 lines
422 B
Ruby
|
# frozen_string_literal: true
|
||
|
|
||
|
module Doorkeeper
|
||
|
module ConnectedDeviceLogging
|
||
|
extend ActiveSupport::Concern
|
||
|
|
||
|
included do
|
||
|
after_action :log_connected_device, only: :create
|
||
|
end
|
||
|
|
||
|
private
|
||
|
|
||
|
def log_connected_device
|
||
|
return if @authorize_response.is_a?(Doorkeeper::OAuth::ErrorResponse)
|
||
|
|
||
|
ConnectedDevice.from_request_headers(request.headers, @authorize_response&.token)
|
||
|
end
|
||
|
end
|
||
|
end
|