spritlesoftware / chargebee-rails-subscriptions

This gem provides developers with the ability to easily integrate chargebee's subscription management into their application backed by active record models.
https://rubygems.org/gems/chargebee_rails
Other
29 stars 25 forks source link

Chargebee API colliding with devise current_user #24

Open gabrielboeker opened 4 years ago

gabrielboeker commented 4 years ago

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?