@osimart/create-storefront 1.0.16 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Guards customer-only pages (user-profile, etc.).
3
+ * Reads the same "token" cookie TokenService writes; useCookie works on
4
+ * both SSR and client, so the redirect happens before the page renders.
5
+ */
6
+ export default defineNuxtRouteMiddleware((to) => {
7
+ const token = useCookie("token");
8
+ if (!token.value) {
9
+ return navigateTo({ path: "/login", query: { redirect: to.fullPath } });
10
+ }
11
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osimart/create-storefront",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "description": "Osimart storefront platform — logic, platform pages and CLI; extended by every theme repo",
5
5
  "type": "module",
6
6
  "main": "./nuxt.config.ts",