Skip to content

Add check for localStorage writeability #1105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2021

Conversation

dennisholmer
Copy link
Contributor

Issue:
Running the library as a third-party (eg. inside an iFrame) when third-party cookies are disabled (as is starting to be default setting in browsers) or cookies disabled, also disables access to localStorage. This can be worked around by providing a custom storage in configuration, but it still breaks because the check for setting saveNoncesInLocalStorage breaks at typeof window['localStorage'] !== 'undefined' due to access issues.

Fix:
Do the check inside try/catch.
image

@dennisholmer
Copy link
Contributor Author

@robke007 Could this also be merged?

@manfredsteyer manfredsteyer merged commit ac931de into manfredsteyer:master Nov 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants