This gem provides developers with the ability to easily integrate chargebee's subscription management into their application backed by active record models.
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.
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 auser_id
column, the helpercurrent_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 toif Invoices.where(user_id: current_user.id).count > 0
the error disappears.any idea?