Skip to content
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

[Bug]: Crash on page load if cookies and site data are disabled #1660

Open
LGLN-LS opened this issue Jan 24, 2023 · 4 comments
Open

[Bug]: Crash on page load if cookies and site data are disabled #1660

LGLN-LS opened this issue Jan 24, 2023 · 4 comments

Comments

@LGLN-LS
Copy link

LGLN-LS commented Jan 24, 2023

Version

14.1.5

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

DOMException: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.
    at DefaultSessionStorageService.read (http:https://localhost:4200/vendor.js:119650:5)
    at BrowserStorageService.read (http:https://localhost:4200/vendor.js:112629:55)
    at StoragePersistenceService.read (http:https://localhost:4200/vendor.js:112717:53)
    at ConfigurationService.enhanceConfigWithWellKnownEndpoint (http:https://localhost:4200/vendor.js:117806:82)
    at ConfigurationService.handleConfig (http:https://localhost:4200/vendor.js:117800:42)
    at http:https://localhost:4200/vendor.js:117776:59
    at Array.map (<anonymous>)
    at ConfigurationService.prepareAndSaveConfigs (http:https://localhost:4200/vendor.js:117776:45)
    at http:https://localhost:4200/vendor.js:117736:114
    at doInnerSub (http:https://localhost:4200/vendor.js:10974:70)


### Steps to reproduce the behavior

```true
If a user has disabled "Cookies and Site Data" in the browser settings, the above crash immediately occurs when loading the page.

To disable cookies and site data follow this instructions:
- Edge: https://cookie-script.com/knowledge-base/disable-cookies-edge
- Firefox: https://cookie-script.com/knowledge-base/disable-cookies-firefox
- Chrome: https://cookie-script.com/knowledge-base/disable-cookies-chrome

A clear and concise description of what you expected to happen.

I expect no crash on page load. The user should be logged out. Login should not work, maybe throw an exception when calling the authorize() method.

Additional context

No response

@damienbod
Copy link
Owner

The lib does not use cookies or same site features. If this happens, it's the settings on the OIDC server.

@LGLN-LS
Copy link
Author

LGLN-LS commented Apr 17, 2023

@damienbod that is not true. If you look at the crash dump, the crash happens in the DefaultSessionStorageService which is the default storage mechanism of your library. sessionStorage is accessed without checking if it is available.

sessionStorage and localStorage are not available, if you disable Cookies and Site Data in your browser settings.

@damienbod
Copy link
Owner

ah, ok the app uses session storage per default. If you disable this it will not work and you would need to implement some type of custom storage. Question is, why would you disable session storage?

We could add docs for this, good?

Greetings Damien

@LGLN-LS
Copy link
Author

LGLN-LS commented Apr 17, 2023

I run a public website with enough visitors to say: These people exist, and from time to time someone complains about this crash.
This type of user is rare, but some people like excessive privacy settings that break things.

The problem, in my opinion, is that loading the website already causes this crash. It is not necessary to click on the login button. There is no way for me to catch this error, the library has to do so.

@damienbod damienbod added the bug label Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants