una-nuxt-module 1.0.12 → 1.0.13
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.
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { createResolver, defineNuxtModule, useLogger, extendPages, addLayout, ad
|
|
|
2
2
|
import { defu } from 'defu';
|
|
3
3
|
|
|
4
4
|
const name = "una-nuxt-module";
|
|
5
|
-
const version = "1.0.
|
|
5
|
+
const version = "1.0.13";
|
|
6
6
|
|
|
7
7
|
function resolve(path) {
|
|
8
8
|
const resolver = createResolver(import.meta.url);
|
|
@@ -5,15 +5,18 @@ import {
|
|
|
5
5
|
useAsyncData,
|
|
6
6
|
useAuthStore,
|
|
7
7
|
useI18n,
|
|
8
|
+
useNuxtApp,
|
|
8
9
|
useRuntimeConfig
|
|
9
10
|
} from "#imports";
|
|
10
11
|
import getCurrentPath from "../utils/getCurrentPath.js";
|
|
11
12
|
export const useAuthorization = () => {
|
|
12
13
|
const currentResource = ref(getCurrentPath());
|
|
13
14
|
const isPageUnprotected = (page) => {
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
|
|
15
|
+
const nuxtApp = useNuxtApp();
|
|
16
|
+
return nuxtApp.runWithContext(
|
|
17
|
+
() => useRuntimeConfig().public.unaNuxtModule.navigation.unprotectedPages.includes(
|
|
18
|
+
page
|
|
19
|
+
)
|
|
17
20
|
);
|
|
18
21
|
};
|
|
19
22
|
const hasAccess = () => {
|