You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
Use Firefox in Private mode, or Android in private mode, or a page that uses Clerk in an iframe with locked-down sandbox permissions
Expected behavior:
Clerk is safe in its usage of localStorage APIs.
Actual behavior:
It isn't, it calls localStorage.getItem and produces an uncaught error.
There is a previous issue about this in the context of expo: #1620
But this isn't safe enough. It's pretty clear from history that localStorage is an 'exploding API' when used in paranoid browser environments: the window exists, maybe localStorage exists, and the method localStorage.getItem exists, but if you call localStorage.getItem() it'll throw an error. Examples from prod:
SecurityError: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
This can also happen if someone has Firefox with dom.storage.enabled turned off, and many folks do.
Preliminary Checks
I have reviewed the documentation: https://clerk.com/docs
I have searched for existing issues: https://github.com/clerk/javascript/issues
I have not already reached out to Clerk support via email or Discord (if you have, no need to open an issue here)
This issue is not a question, general help request, or anything other than a bug report directly related to Clerk. Please ask questions in our Discord community: https://clerk.com/discord.
Reproduction
http://val.town/
Publishable key
pk_test_aHVtb3JvdXMtZGFzc2llLTE4LmNsZXJrLmFjY291bnRzLmRldiQ
Description
Steps to reproduce:
Expected behavior:
Clerk is safe in its usage of localStorage APIs.
Actual behavior:
It isn't, it calls
localStorage.getItem
and produces an uncaught error.There is a previous issue about this in the context of expo: #1620
But this isn't safe enough. It's pretty clear from history that localStorage is an 'exploding API' when used in paranoid browser environments: the
window
exists, maybelocalStorage
exists, and the methodlocalStorage.getItem
exists, but if you calllocalStorage.getItem()
it'll throw an error. Examples from prod:This can also happen if someone has Firefox with
dom.storage.enabled
turned off, and many folks do.See previous discussion here: https://mathiasbynens.be/notes/localstorage-pattern#comment-9 - basically any operations on localstorage should be expected to throw errors in locked-down browser environments.
Environment
The text was updated successfully, but these errors were encountered: