Fix bugs in `extend_remember_period` (reprise)
close #5351, close #5418, close #5701
This pull request contains the same changes as https://github.com/heartcombo/devise/pull/5418. However, since PR #5418 was created three years ago, it needed conflict resolution. While I could have asked @nomis to resolve the conflicts, I decided to create a new PR myself since it was just a matter of resolving those conflicts. With this fix, extend_remember_period now works as expected on my end.
@dlwr This looks great - I have been trying to work out what's going on with devise...
However it doesn't seem to fix the following problem (which seems to be very similar to the test case):
Setting timeoutable timeout_in to 30s and rememberable remember_for to 90s (with extend remember period). Log in with remember me checked Wait 45s. Navigate/refresh (logged in still, remembered) Wait 35s. Navigate/refresh (logged in still, remembered, extended) Wait 35s Navigate/refresh ...
Expect to be logged in because remember cookie should extended and honoured, but logged out.
I created this repo to test it: https://github.com/timdiggins/devise-rememberable (with devise/main)
I used this branch of devise in https://github.com/timdiggins/devise-rememberable/tree/use-original-fix-branch And used a rebase-version of it in https://github.com/timdiggins/devise-rememberable/tree/use-fix-branch
Neither of these branches fixed the problem (at least using rails 7.1 and ruby 3.0)
Any ideas why this isn't working?
@timdiggins
Hi. I think you should set extend_remember_period to true 😄
https://github.com/timdiggins/devise-rememberable/blob/f4bbc7dc8bd43f9ae53d762eb4521414c7bb537b/config/initializers/devise.rb#L173
@timdiggins
Hi. I think you should set
extend_remember_periodto true 😄https://github.com/timdiggins/devise-rememberable/blob/f4bbc7dc8bd43f9ae53d762eb4521414c7bb537b/config/initializers/devise.rb#L173
OMG 🤦 Thank you! I will retry with the correct setup
@dlwr Just to confirm - it now works in this relatively real world test (both with this PR and this PR rebased on main).
Polite request for a review from @nashby or another maintainer?