Mateu
Mateu

Reputation: 2698

Rails devise app to create a REST api for mobile application

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

Answers (1)

user1414900
user1414900

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

Related Questions