You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm getting this error when I call the API without, or with a wrong, authentication token:
class ApiController < ActionController::API
include ActionController::HttpAuthentication::Token::ControllerMethods
before_action :authenticate
def authenticate
authenticate_or_request_with_http_token do |token, _options|
ActiveSupport::SecurityUtils.secure_compare(token, Rails.application.credentials.api_key)
end
end
....
end
application.rb
require_relative "boot"
require "rails/all"
Bundler.require(*Rails.groups)
module MyApp
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.load_defaults 7.0
.....
# log to InboundRequestsLoggerMiddleware only requests from /api
config.middleware.insert_before Rails::Rack::Logger, InboundRequestsLoggerMiddleware, path_regexp: /api/
....
end
end
We released a new version (0.8.2) which should solve a similar problem when used in combination with Appsignal. See appsignal/appsignal-ruby#1265. Let me know if the problem is solved, please.
rails_api_logger 0.6.3
rails 7.0.3
I'm getting this error when I call the API without, or with a wrong, authentication token:
application.rb
The stacktrace:
The text was updated successfully, but these errors were encountered: