spritlesoftware/chargebee-rails-subscriptions

Chargebee API colliding with devise current_user

Opened this issue · 0 comments

apparently chargbee's api seem to collide with the devise current_user helper. The error seem not to be consistent for every model but if a model has a user_id column, the helper current_user leads to an authentication error in the controller.

logs:
ChargeBee::InvalidRequestError (XXXXXXXXXXXXXXX not found):

rails debugger:
Sorry,authentication failed. The authorization header for basic authentication not present in request

The request is nothing related to chargebee in this case – new action:
if current_user.invoices.count > 0 this line leads to the error... when changing to
if Invoices.where(user_id: current_user.id).count > 0 the error disappears.

any idea?