Correcting Base64 String for random state #31
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.
Description
The replace function requires a regular expression if you want it to replace more than one instance of the sanitized characters. My change switches the string format from base64 to base64url which renders the entire string url safe and eliminates the need for string replacement.
Motivation and Context
This fix is required because the current version causes some users to fail logins because the state does not match the original state when it is returned.
This fix is in reference to this issue: #28
How Has This Been Tested?
I ran your unit tests and also created my own test where I submitted the state an compared it 100000 times to make sure it was always equal to the original state after coming in through the HTTP engine of NodeJS.
Types of Changes