I'm using Devise with token Authentication and, now, I want to encrypt the token in the Database. Can anyone give me a hint where devise does the storing/retrieving of the token from the DB?
I'm also using the attr_encrypted gem with which the whole encryption should be rather easy once the right location is found.
Edit:
I have implemented token authentication like it is described here: http://zyphdesignco.com/blog/simple-auth-token-example-with-devise
I added the following line in the user model, which should encrypt the authentication_token
attr_encrypted :authentication_token, :key => 'a secret key', :attribute => 'authentication_token'
When I run it and try to login, I get following error message:
Completed 500 Internal Server Error in 364ms
SystemStackError - stack level too deep:
(gem) actionpack-3.2.13/lib/action_dispatch/middleware/reloader.rb:70:in `'
It seems there is a conflict with devise and attr_encrypted and that both are fighting over redefinition of the authentication_token method (thx for the hint @sbfaulkner)
Maybe someone had a similar problem and knows a solution?