当前位置: 动力学知识库 > 问答 > 编程问答 >

ruby on rails - InvalidAuthenticityToken error when using token based authentication in devise

问题描述:

I've enable token based authentication (token_authenticatable) in devise in my rails app and it's working well. Now I'm making an android application that uses the web service provided by this rails app. It stores the devise auth_token after first login and uses it to make subsequent requests so that user does not have to log in later. The problem is that I get InvalidAuthenticityToken error when I call the update action from the android app. I don't want to make an extra call to the server to get the authenticity token or remove protect_from_forgery from the update action. Any suggestions?

网友答案:

Look into using stateless tokens. They should be just what you need. Rails. Devise and Stateless tokens.

分享给朋友:
您可能感兴趣的文章:
随机阅读: