@inzombieland/nuxt-common 1.19.2 → 1.19.4
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 +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/packages/core/api-client.mjs +3 -1
- package/dist/runtime/packages/core/composables/use-active-sessions.mjs +1 -10
- package/dist/runtime/packages/core/init-application.mjs +1 -0
- package/dist/runtime/packages/core/package.json +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
2
2
|
import { defineNuxtModule, createResolver, addServerHandler, addImportsDir, addPlugin, addComponent } from '@nuxt/kit';
|
|
3
3
|
|
|
4
4
|
const name = "@inzombieland/nuxt-common";
|
|
5
|
-
const version = "1.19.
|
|
5
|
+
const version = "1.19.4";
|
|
6
6
|
|
|
7
7
|
const module = defineNuxtModule({
|
|
8
8
|
meta: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useApiActions, useUser, useVisitor } from "./composables/index.mjs";
|
|
1
|
+
import { useActiveSessions, useApiActions, useUser, useVisitor } from "./composables/index.mjs";
|
|
2
2
|
import { apiHelper, once } from "./helpers/index.mjs";
|
|
3
3
|
import { useBus } from "./index.mjs";
|
|
4
4
|
let token = null;
|
|
@@ -23,6 +23,8 @@ export const setToken = (newToken) => {
|
|
|
23
23
|
export const flush = () => {
|
|
24
24
|
setToken(null);
|
|
25
25
|
setUser(null);
|
|
26
|
+
const activeSessions = useActiveSessions();
|
|
27
|
+
activeSessions.value = [];
|
|
26
28
|
};
|
|
27
29
|
const eventHandler = (requestID, eventName) => {
|
|
28
30
|
return new Promise((resolve, reject) => {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useUser } from "../composables/index.mjs";
|
|
1
|
+
import { ref } from "vue";
|
|
3
2
|
import { useUserActions } from "../index.mjs";
|
|
4
3
|
const activeSessions = ref([]);
|
|
5
4
|
export function useActiveSessions() {
|
|
@@ -11,13 +10,5 @@ export function useActiveSessions() {
|
|
|
11
10
|
}
|
|
12
11
|
};
|
|
13
12
|
fetchActiveSessions();
|
|
14
|
-
onMounted(() => {
|
|
15
|
-
const user = useUser();
|
|
16
|
-
watch(user, (user2) => {
|
|
17
|
-
if (!user2) {
|
|
18
|
-
activeSessions.value = [];
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
13
|
return activeSessions;
|
|
23
14
|
}
|