Update Refreshable hook and helper methods to get/set values as strings again #81
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@strzibny, I have identified a regression in the new Refreshable functionality, where the "credentials_refreshed_at" session value is not available to the needs_credentials_refresh? method, as Rack converts symbols to strings when storing session values. This causes the user to redirect continually to the otp/credentials/refresh page when trying to view the otp/token page since warden.session[:credentials_refreshed_at] remains nil.
I tried converting the symbols to strings where needed within the helper mehtods (e.g. needs_credentials_refresh?), but then the tests were failing. The reason for this appears to be that the test environment still get/sets symbols as symbols in the Rack session (as opposed to converting them to strings).
A simple solution is to utilize strings again for all get/set methods as before. This PR makes this change, and resolves the redirect issue mentioned above.
Leads: