Reputation: 2698
I'm building a REST api using Rails 4 to be used in a mobile application. I'm using devise for Users. Api operations will only be accesible by logged in users.
I've been looking how to perform this. 1. The first solution I see is using token_authentication but it has been disabled by devise. 2. If I try to log-in using normal controllers I get a "Can't verify CSRF token authenticity"
How should I proceed?
Upvotes: 2
Views: 1107
Reputation: 91
Add skip_before_filter :verify_authenticity_token
to your API controller.
But true way for this case it's https://github.com/doorkeeper-gem/doorkeeper
Upvotes: 2