heartcombo / devise

Flexible authentication solution for Rails with Warden.
http://blog.plataformatec.com.br/tag/devise/
MIT License
23.83k stars 5.53k forks source link

Possibly incorrect skip_trackable check for timeoutable #5649

Open jpcody opened 8 months ago

jpcody commented 8 months ago

Pre-check

Environment

Current behavior

Timeoutable primarily concerns itself with last_request_at. But for storing this value in the session, the code checks unless env['devise.skip_trackable']. Trackable doesn't concern itself with last_request_at, so it's unclear why this check exists.

In our codebase, we're attempting to skip trackable to call update_tracked_fields! ourselves, but this incidentally breaks timeoutable by failing to store last_request_at.

I'm happy to PR this, but given the code was written 11 years ago, I was reticent without first confirming this was undesired behavior.

Expected behavior

Setting env['devise.skip_trackable'] to false should have no effect on last_request_at being stored.