Include AuthenticationHelpers in Spree's Controllers

I was using devise on it's own, following this guide:
http://guides.spreecommerce.com/developer/authentication.html

I encountered issues using the admin backend because the ajax calls to the
api weren't being authenticated. For example, generating the list of taxons
to choose from in the select2 dropdown was failing, as well as loading the
tree for editing taxons.

Adding these lines fixed it for me, because I realized the authentication
helper methods weren't available in any of the API's controllers, but maybe
something else is up?


On Wed, Jul 16, 2014 at 10:52 PM, Washington L Braga Jr <
notifications@github.com> wrote:

> In core/lib/generators/spree/custom_user/templates/
> authentication_helpers.rb.tt:
>
> > @@ -25,4 +25,6 @@ module Spree
> >    end
> >  end
> >
> > -ApplicationController.send :include, Spree::AuthenticationHelpers
> > +Spree::BaseController.send      :include, Spree::AuthenticationHelpers
> > +Spree::Api::BaseController.send :include, Spree::AuthenticationHelpers
>
> Not clear to me why we would need to add this to spree/api either, could
> you elaborate please?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/spree/spree/pull/4996/files#r15039221>.
>