Class: Api::Vendor::V1::Pointx::BaseController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Api::Vendor::V1::Pointx::BaseController
- Includes:
- ElasticAPM::SpanHelpers
- Defined in:
- app/controllers/api/vendor/v1/pointx/base_controller.rb
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from ApplicationController
#after_sign_in_path_for, #after_sign_out_path_for, #default_url_options, #render_not_found, #routing_error, search_params_key=
Methods included from LogrageCustomLogger
Methods included from ControllerHelpers
#check_boolean_param, #get_banners, #inventory_params, #reservation_params
Instance Method Details
#authenticate! ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/api/vendor/v1/pointx/base_controller.rb', line 12 def authenticate! token = request.headers['vendor-webview-integration-token'] if token.present? doorkeeper_app = find_webview_doorkeeper_app raise 'Webview integration app not found' if doorkeeper_app.blank? raise 'Invalid authentication token' if token != doorkeeper_app.uid true else raise 'missing authentication header' end rescue StandardError => e APMErrorHandler.report( "PointX: #{e.}", context: { provided_token: token, ip: request.remote_ip, request: request, }, ) render json: { error: 'Sorry, Something went wrong' }, status: :unauthorized end |
#identity_cache_memoization(&block) ⇒ Object
37 38 39 |
# File 'app/controllers/api/vendor/v1/pointx/base_controller.rb', line 37 def identity_cache_memoization(&block) IdentityCache.cache.with_memoization(&block) end |