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

[ERROR] [AUTH] DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document. #833

Closed
Vignesh-cgs opened this issue Sep 19, 2020 · 5 comments

Comments

@Vignesh-cgs
Copy link

Vignesh-cgs commented Sep 19, 2020

Incognito window in Chrome: While am using the inside of an iframe. An error was shown. please help to solve,

[ERROR] [AUTH] DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.

I have Changed to localStorage: false in the nuxt_config.js file, but still not fixed the issue

auth: {
    fullPathRedirect: true,
    rewriteRedirects: true,
    watchLoggedIn: true,
    resetOnError: true,
    localStorage: false,
    redirect: {
      login: '/login',
      logout: '/',
      callback: '/login',
      home: false
    },
    strategies: {
      local: {
        endpoints: {
          login: { url: 'api/login', method: 'post', propertyName: 'data.token' },
          logout: { url: '/api/logout', method: 'post' },
          user: { url: '/api/shop/getUserInfo', method: 'post', propertyName: 'data' },
        },
        tokenType: 'Bearer',
        autoFetchUser: false,
        autoLogout: true,
      },
    }
  }
@bmulholland
Copy link
Contributor

We don't explicitly support working inside of an iframe, and I can imagine several issues and maybe even security issues that could arise from that scenario. That said, disabling localstorage should be supported. What nuxt version was this with? Is the issue present in the latest version of nuxt/auth-next?

@Vignesh-cgs
Copy link
Author

I have Used these dependencies

"dependencies": {
    "@nuxtjs/auth": "^4.9.1",
    "@nuxtjs/axios": "^5.12.0",
    "@nuxtjs/bootstrap-vue": "^2.0.4",
    "@nuxtjs/proxy": "^2.0.1",
    "@stripe/stripe-js": "^1.9.0",
    "aes256": "^1.0.4",
    "axios": "^0.19.0",
    "base-64": "^0.1.0",
    "bootstrap-vue": "^2.19.0",
    "cookieparser": "^0.1.0",
    "element-ui": "^2.13.0",
    "js-cookie": "^2.2.1",
    "lodash": "^4.17.19",
    "mockjs": "^1.1.0",
    "nuxt": "^2.9.2",
    "nuxt-cookie-control": "^1.8.8",
    "nuxt-i18n": "^6.6.0",
    "qrcode": "^1.4.4",
    "utf8": "^3.0.0",
    "vee-validate": "^3.1.0",
    "vue": "^2.6.10",
    "vue-awesome-swiper": "^3.1.3",
    "vue-cookie-law": "^1.13.3",
    "vue-gallery": "^2.0.1",
    "vue-i18n": "^8.15.5",
    "vue-image-lightbox": "^6.4.0",
    "vue-image-magnifier": "^0.2.1",
    "vue-infinite-loading": "^2.4.4",
    "vue-instagram": "^2.0.1",
    "vue-lazyload": "^1.3.3",
    "vue-masonry": "^0.11.8",
    "vue-paypal-checkout": "^3.2.0",
    "vue-product-zoomer": "^3.0.0",
    "vue-slider-component": "^3.0.41",
    "vue2-animate": "^2.1.2",
    "vue2-filters": "^0.7.2",
    "vuejs-paginate": "^2.1.0",
    "vuex": "^3.1.1",
    "vuex-persistedstate": "^2.5.4"
  },

image

@bmulholland
Copy link
Contributor

Thanks Vignesh. Is the issue present in the latest version of nuxt/auth-next?

@esinner9
Copy link

esinner9 commented Jan 4, 2022

@bmulholland I have a PR that should fix this... #1405

@bmulholland
Copy link
Contributor

bmulholland commented Jan 7, 2022

Fixed in #1415. Thanks again!

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

3 participants