Devise Authentication Token

Posted on 07 Oct 2011 by Eric Oestrich

I started using the devise authentication token for a project recently and was confounded on how to get the token from the client’s perspective. After fiddling with different ways, I finally found that adding :authentication_token to attr_accessible let’s it slide through the post to sign_in.

class User
  attr_accessible :authentication_token

    curl -d "user[email][password]=password"

comments powered by Disqus
Creative Commons License
This site's content is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License unless otherwise specified. Code on this site is licensed under the MIT License unless otherwise specified.