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

Seem to get a security error on nativeStorage #147

Open
jonyeezs opened this issue Feb 5, 2021 · 1 comment
Open

Seem to get a security error on nativeStorage #147

jonyeezs opened this issue Feb 5, 2021 · 1 comment

Comments

@jonyeezs
Copy link

jonyeezs commented Feb 5, 2021

Versions (please complete the following information):

  • NgxWebstorage: 4.0.1
  • Angular: 8

Describe the bug

We are getting a security error on our end which happens on your code. Unfortunately unable to know how this is reproducable.

The error message is:

SecurityError: The operation is insecure.

To Reproduce
Sorry not sure how to as this was reported by the log error on a user machine.

Expected behavior
Shouldn't be getting any errors

If applicable, add screenshots to help explain your problem.

Code where it happens

import {WebStorage} from './interfaces/webStorage';
export const LOCAL_STORAGE: InjectionToken<WebStorage> = new InjectionToken<WebStorage>('window_local_storage');

export function getLocalStorage() {
// -----> THIS IS WHERE THE ERROR HAPPENS <----------
	return (typeof window !== 'undefined') ? window.localStorage : null;
}

export const LocalStorageProvider: FactoryProvider = {provide: LOCAL_STORAGE, useFactory: getLocalStorage};
export const SESSION_STORAGE: InjectionToken<WebStorage> = new InjectionToken<WebStorage>('window_session_storage');

Desktop (please complete the following information):

  • OS: iOS 14.2
  • Browser: Mobile Safari
  • Version 14.0.1

Additional context
Add any other context about the problem here.

@jonyeezs
Copy link
Author

jonyeezs commented Mar 3, 2021

Hmmm wonder if this could be also related to #111

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

No branches or pull requests

1 participant