Store plain Hash in session['authorize_params'] #150
Merged
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.
This PR relates to Auth0 support ticket #01310199.
The
params
object that gets stored insession['authorize_params']
for token verification is an instance ofOmniAuth::Strategy::Options
, an eventual subclass ofHashie::Mash
. In reality, it's always treated as a regular hash, and none ofHashie::Mash
's features are used.Since values in the session get serialized into a session store (e.g.,
Redis::Store
in our case), thissession['authorize_params]'
value is getting serialized as an instance ofOmniAuth::Strategy::Options
. This causes problems when code that doesn't have theOmniAuth::Strategy::Options
class loaded tries to load the session and deserialize its contents. Since thisOptions
class is unknown, the code that's loading the session blows up.This patch simply gets a regular hash from the
params
object before storing it in the session. This way, we're just storing a plain RubyHash
, which is guaranteed to be available by any code that needs to deserialize the session.Changes
Please describe both what is changing and why this is important. Include:
References
Please include relevant links supporting this change such as a:
Testing
Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.
Checklist