Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

token_authenticatable updating model on each request #1959

Closed
abrisse opened this Issue Jul 4, 2012 · 2 comments

Comments

Projects
None yet
2 participants

abrisse commented Jul 4, 2012

I am using Devise 2.1.2.
My User model is :token_authenticatable and :trackable.

Current Behaviour

When using warden.authenticate(:scope => :user), the User instance is updated and the sign_in_count is increased.

Normal Behaviour

When using warden.authenticate(:scope => :user), the User instance should not be updated and thefore the sign_in_count not increased.

Hack

before_filter :skip_trackable

 def skip_trackable
    request.env['devise.skip_trackable'] = true
 end
Owner

josevalim commented Jul 4, 2012

Yes, everything is correct. This is not a hack, but actually the proper solution. Maybe we could improve the documentation to make it more clear?

abrisse commented Jul 4, 2012

Thanks for the reply Jose. Yep, documentation should be updated then.

@josevalim josevalim closed this in 1da8490 Jul 23, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment