nuxt-directus-sdk 5.0.0-beta.6 → 5.0.0-beta.8
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/README.md +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/plugin.js +14 -12
- package/package.json +5 -5
package/README.md
CHANGED
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { generateTypes } from '../dist/runtime/types/index.js';
|
|
|
6
6
|
import { useUrl } from '../dist/runtime/utils/index.js';
|
|
7
7
|
|
|
8
8
|
const name = "nuxt-directus-sdk";
|
|
9
|
-
const version = "5.0.0-beta.
|
|
9
|
+
const version = "5.0.0-beta.8";
|
|
10
10
|
|
|
11
11
|
const configKey = "directus";
|
|
12
12
|
const logger = useLogger("nuxt-directus-sdk");
|
package/dist/runtime/plugin.js
CHANGED
|
@@ -34,18 +34,20 @@ export default defineNuxtPlugin({
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
const authEnabled = config.public.directus.auth?.enabled ?? true;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
if (authEnabled) {
|
|
38
|
+
const sessionCookie = useCookie("directus_session_token");
|
|
39
|
+
const directusUrlCookie = useCookie("directus_instance_url");
|
|
40
|
+
const currentDirectusUrl = useDirectusOriginUrl();
|
|
41
|
+
if (directusUrlCookie.value && directusUrlCookie.value !== currentDirectusUrl) {
|
|
42
|
+
sessionCookie.value = null;
|
|
43
|
+
}
|
|
44
|
+
directusUrlCookie.value = currentDirectusUrl;
|
|
45
|
+
if (directusAuth.user.value === null && sessionCookie.value) {
|
|
46
|
+
const user = await directusAuth.readMe();
|
|
47
|
+
await nuxtApp.callHook("directus:loggedIn", user);
|
|
48
|
+
} else {
|
|
49
|
+
await nuxtApp.callHook("directus:loggedIn", null);
|
|
50
|
+
}
|
|
49
51
|
}
|
|
50
52
|
}
|
|
51
53
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-directus-sdk",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.0.0-beta.
|
|
4
|
+
"version": "5.0.0-beta.8",
|
|
5
5
|
"description": "A Directus nuxt module that uses the Directus SDK",
|
|
6
6
|
"author": "Matthew Rollinson <matt@rolley.io>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"docs:preview": "vitepress preview docs"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@directus/sdk": "
|
|
40
|
-
"@directus/types": "
|
|
41
|
-
"@directus/visual-editing": "
|
|
42
|
-
"@nuxt/image": "
|
|
39
|
+
"@directus/sdk": ">=20.0.0",
|
|
40
|
+
"@directus/types": ">=13.0.0",
|
|
41
|
+
"@directus/visual-editing": ">=1.1.0",
|
|
42
|
+
"@nuxt/image": ">=2.0.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependenciesMeta": {
|
|
45
45
|
"@directus/types": {
|