\r\n \u003Cnuxt :authed=\"authed\"/>\r\n \u003C/div>\r\n\u003C/template>\r\n\r\n\u003Cscript>\r\n import AppNav from '~components/Nav.vue'\r\n\r\n export default {\r\n data: function () {\r\n return {\r\n authed: false\r\n }\r\n },\r\n\r\n components: {\r\n AppNav\r\n },\r\n\r\n created: () => {\r\n this.authed = localStorage.getItem('token') !== null\r\n }\r\n}\r\n\u003C/script>\r\n```\r\n\r\nThis example would generate an error ```localStorage is not defined```\r\n\r\nHow can I accomplish this?\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This question is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c157\">#c157\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[2026,2029],{"name":2027,"color":2028},"question","cc317c",{"name":1987,"color":1988},185,"read local storage on default layout?","2023-01-18T15:38:32Z","https://github.com/nuxt/nuxt/issues/185",0.751804,{"description":2036,"labels":2037,"number":2039,"owner":1990,"repository":1990,"state":1991,"title":2040,"updated_at":2041,"url":2042,"score":2043},"Is this still completely impossible without using session or cookies?\r\n\r\nI'm working towards a quick generated site, with a very basic vuex store. I'd just like to persist some data across refreshes. I've tried hacking together a workaround by setting localstorage at the same time as setting the state, and then reading the state back from localstorage in a middleware, but obviously window not found is getting in the way.\r\n\r\nAny quick tips? If there are any it would be great to see the FAQ updated.\r\n\r\nNote - spa mode is not an option due to SEO concerns - which is the whole reason for using nuxt.\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This question is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1467\">#c1467\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[2038],{"name":1987,"color":1988},1641,"Localstorage / persisting vuex","2023-01-18T15:42:07Z","https://github.com/nuxt/nuxt/issues/1641",0.75228477,{"labels":2045,"number":2047,"owner":1990,"repository":1990,"state":1991,"title":2048,"updated_at":2049,"url":2050,"score":2051},[2046],{"name":1987,"color":1988},6410,"Into `static` dir. Are you sure older favicon is not cached in browser? ( You may ensure it by pushing a hash after href like : `href: 'favicon.ico?v2'`)","2023-01-18T21:49:13Z","https://github.com/nuxt/nuxt/issues/6410",0.7536109,{"description":2053,"labels":2054,"number":2057,"owner":1990,"repository":1990,"state":1991,"title":2058,"updated_at":2059,"url":2060,"score":2061},"becasuse nuxt cannot use localStorage to save user token, so i used \"nuxtServerInit\" API ,started local server and simulation localstorage through \"req.session\",.yes, it succeed. however, this req.session only save the current server, when people connect to other servers, this record has disappeared. so i want to know that how to achieve the purpose of stateless login\r\n\r\nlocal server\r\n\r\n\r\nnuxtServerInit\r\n\r\n\r\n\n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This question is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1933\">#c1933\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[2055,2056],{"name":2027,"color":2028},{"name":1987,"color":1988},2192,"how can i achieve the purpose of stateless login","2023-01-18T15:43:11Z","https://github.com/nuxt/nuxt/issues/2192",0.754314,{"description":2063,"labels":2064,"number":2071,"owner":1990,"repository":1990,"state":1991,"title":2072,"updated_at":2073,"url":2074,"score":2075},"### Environment\r\n\r\nNuxt 3.5\r\nNode 18\r\n\r\n### Reproduction\r\n\r\nSo we have Nitro Cache API documentation https://nitro.unjs.io/guide/cache\r\nAs well as an option to create custom driver for Unstorage: https://unstorage.unjs.io/custom-driver\r\n\r\n\r\n```js\r\n// Creating custom driver\r\nimport { createStorage, defineDriver } from \"unstorage\";\r\n\r\nconst myStorageDriver = defineDriver((options) => {\r\n return {\r\n name: \"my-custom-driver\",\r\n options,\r\n async hasItem(key, _opts) {},\r\n async getItem(key, _opts) {},\r\n async setItem(key, value, _opts) {},\r\n async removeItem(key, _opts) {},\r\n async getKeys(base, _opts) {},\r\n async clear(base, _opts) {},\r\n async dispose() {},\r\n async watch(callback) {},\r\n };\r\n});\r\n\r\nconst storage = createStorage({\r\n driver: myStorageDriver(),\r\n```\r\n\r\nHow to use that driver in Nuxt? Where to register it / import? I tried to put it in plugins, however did not succeed.\r\nBelow solution won't work, nuxt can't find it (unsuprisingly)\r\n```js\r\n// nuxt.config.ts\r\nexport default defineNuxtConfig({\r\n nitro: {\r\n storage: {\r\n cache: {\r\n driver: 'my-custom-driver'\r\n }\r\n }\r\n }\r\n})\r\n```\r\n\r\n### Describe the bug\r\n\r\nWhile in-memory production cache is nice for small-scale apps, in large-scale application we would like to connect to external key-value storage (which driver preset is not predefined in Unstorage, like Redis).\r\n\r\nWe would like to enable page-caching (enabling cache in route rules) in external storage and purge cache with our backend.\r\n\r\nAssuming we successfully created custom cache driver, there is no documentation on how to connect it with Nuxt app (and how nuxt will use it to serve page from cache).\r\n\r\n### Additional context\r\n\r\n_No response_\r\n\r\n### Logs\r\n\r\n_No response_",[2065,2068],{"name":2066,"color":2067},"3.x","29bc7f",{"name":2069,"color":2070},"pending triage","E99695",22990,"Cache: Can't use Unstorage custom driver with Nitro Cache in Nuxt 3","2023-09-12T19:42:54Z","https://github.com/nuxt/nuxt/issues/22990",0.75505924,{"description":2077,"labels":2078,"number":2080,"owner":1990,"repository":1990,"state":1991,"title":2081,"updated_at":2082,"url":2083,"score":2084},"I have a survey with 5 different questions, the state of the questions is stored in a vuex store. These questions are used on different pages in the application. When I refresh the page the state is lost and gives an error.\r\n\r\nI have been looking at vuex-persistedstate, but it doesn't work together with nuxt as described in the issue below:\r\nhttps://github.com/robinvdvleuten/vuex-persistedstate/issues/16\r\n\r\nMy idea is to implement a local storage but unfortunately I did not succeed so far. I found this issue talking about local storage: https://github.com/nuxt/nuxt.js/issues/185 and it says we shouldn't use it. \r\n\r\nAre there any suggestions of keeping the vuex state on refresh without creating a session on server (no login). \n\n\u003C!--cmty-->\u003C!--cmty_prevent_hook-->\n\u003Cdiv align=\"right\">\u003Csub>\u003Cem>This question is available on \u003Ca href=\"https://nuxtjs.cmty.io\">Nuxt.js\u003C/a> community (\u003Ca href=\"https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c499\">#c499\u003C/a>)\u003C/em>\u003C/sub>\u003C/div>",[2079],{"name":1987,"color":1988},576,"Best impelentation localStorage","2023-01-18T15:39:31Z","https://github.com/nuxt/nuxt/issues/576",0.7610556,["Reactive",2086],{},["Set"],["ShallowReactive",2089],{"TRc1wZytZ_XrK4EfJfei_Sz-An4H4Yy6syhVxH_PVJc":-1,"2FHP5BXTmtKZTp_B9c6oQmspyNe9FEfqIKqtyBfBkZE":-1},"/nuxt/icon/88"]