@sfxcode/nuxt-mongocamp-server 1.4.3 → 1.4.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
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -33,7 +33,7 @@ export function useMongocampAuth() {
|
|
|
33
33
|
const login2 = { userId: loginId, password: loginPassword };
|
|
34
34
|
const result = await authApi.login({ login: login2 });
|
|
35
35
|
updateUserState(result);
|
|
36
|
-
if (refreshToken) {
|
|
36
|
+
if (refreshToken && import.meta.client) {
|
|
37
37
|
updateTokenInterval = window.setInterval(updateToken, tokenRefreshIntervall);
|
|
38
38
|
}
|
|
39
39
|
return result.userProfile;
|
|
@@ -43,16 +43,18 @@ export function useMongocampAuth() {
|
|
|
43
43
|
const profile = { user: "", isAdmin: false };
|
|
44
44
|
state.value.profile = profile;
|
|
45
45
|
user.value = profile;
|
|
46
|
-
if (refreshToken) {
|
|
46
|
+
if (refreshToken && import.meta.client) {
|
|
47
47
|
window.clearInterval(updateTokenInterval);
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
const isLoggedIn = computed(() => {
|
|
51
51
|
const result = state.value?.token?.length > 0;
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
if (import.meta.client) {
|
|
53
|
+
if (result && refreshToken && !updateTokenInterval) {
|
|
54
|
+
updateTokenInterval = window.setInterval(updateToken, tokenRefreshIntervall);
|
|
55
|
+
} else if (!result && updateTokenInterval) {
|
|
56
|
+
window.clearInterval(updateTokenInterval);
|
|
57
|
+
}
|
|
56
58
|
}
|
|
57
59
|
return result;
|
|
58
60
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sfxcode/nuxt-mongocamp-server",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@nuxt/module-builder": "^1.0.2",
|
|
49
49
|
"@nuxt/schema": "^4.4.8",
|
|
50
50
|
"@nuxt/test-utils": "^4.0.3",
|
|
51
|
-
"@openapitools/openapi-generator-cli": "^2.
|
|
51
|
+
"@openapitools/openapi-generator-cli": "^2.39.0",
|
|
52
52
|
"@types/node": "^26.0.0",
|
|
53
53
|
"@unocss/nuxt": "66.7.2",
|
|
54
54
|
"changelogen": "^0.6.2",
|