Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rails::API support #87

Closed
smarquez1 opened this issue Aug 12, 2014 · 3 comments
Closed

Rails::API support #87

smarquez1 opened this issue Aug 12, 2014 · 3 comments

Comments

@smarquez1
Copy link

The rails-api gem uses ActionController::API instead of ActionController::Base for its controllers. Maybe replacing this line for

ActionController::API.send :include, SimpleTokenAuthentication::ActsAsTokenAuthenticationHandler 

should work

@gonzalo-bulnes
Copy link
Owner

Hello @smarquez1,

That's true, the idea was discussed here. A dummy app is used to test differents aspects of the gem behaviour. That app is generated automatically during each scenario, following a recipe (usage, source) which, at this point, is adapted for a Rails application. A Rails API recipe is what is missing at this point to make a release possible.

If you could adapt that recipe, it would make a very nice -and very welcome- PR. Adding support for Rails API is something that has been around for a time now and I would be glad to help you with the Cucumber scenario if necessary.

Regards!

@rapito
Copy link

rapito commented Aug 13, 2014

Hi there,

I forked @mediateinment _mongoid_ supporting repo and added rails-api support with @smarquez1 suggestions:

ActionController::API.send :include, SimpleTokenAuthentication::ActsAsTokenAuthenticationHandler  

For me it's working OK, you can get it here.

Plus, I added the ability to pass options to before_filter on ActsAsTokenAuthenticationHandler.

@gonzalo-bulnes
Copy link
Owner

Hi @rapito,

Thanks for the PR, however, in order to add both Mongoid and Rails API support, what is missing is testing. Your help would be welcome in both these topics, but I can't accept your PR as-is.

The discussions reated to the Mongoid support are gathered in #38, those related to Rails API in #54.
Please keep the topics separated, that helps in maintaining the documentation searchable as it grows. ; )

Regards!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants