fix: clear PKCE meta before save. favor localSession when reading meta. #441
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 fixes an issue involving PKCE metadata:
This PR fixes the issue by favoring localStorage over sessionStorage in
loadMeta
. If meta exists in both locations, we will use the value in localStorage because it is assumed the meta was put there by an older version of the signin widget, and the data in sessionStorage may be left over from a failed token call that did not clean up after itself.Additionally, we add extra protections:
getToken
to clear PKCE storage. This is where the meta was being left behind by failed token renewThis PR also adds a "login using signin widget" option to test app. This was used to manually reproduce the issue.