@sfxcode/nuxt-mongocamp-server 1.0.8 → 1.0.10
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,6 +2,7 @@ import type { UserProfile } from '../api';
|
|
|
2
2
|
export declare function useMongocampAuth(): {
|
|
3
3
|
login: (loginId: string, loginPassword: string) => Promise<UserProfile>;
|
|
4
4
|
logout: () => void;
|
|
5
|
+
isAuthenticated: () => Promise<import("../api").JsonValueBoolean>;
|
|
5
6
|
isLoggedIn: import("vue").ComputedRef<boolean>;
|
|
6
7
|
userRoles: import("vue").ComputedRef<string[]>;
|
|
7
8
|
userGrants: import("vue").ComputedRef<import("../api").Grant[]>;
|
|
@@ -6,6 +6,9 @@ export function useMongocampAuth() {
|
|
|
6
6
|
const state = useMongocampStorage();
|
|
7
7
|
const { authApi } = useMongocampApi();
|
|
8
8
|
const user = useMongocampUser();
|
|
9
|
+
async function isAuthenticated() {
|
|
10
|
+
return await authApi.isAuthenticated();
|
|
11
|
+
}
|
|
9
12
|
const login = async (loginId, loginPassword) => {
|
|
10
13
|
logout();
|
|
11
14
|
const login2 = { userId: loginId, password: loginPassword };
|
|
@@ -24,5 +27,5 @@ export function useMongocampAuth() {
|
|
|
24
27
|
const isLoggedIn = computed(() => state.value?.token?.length > 0);
|
|
25
28
|
const userRoles = computed(() => state.value.profile.roles ?? []);
|
|
26
29
|
const userGrants = computed(() => state.value.profile.grants ?? []);
|
|
27
|
-
return { login, logout, isLoggedIn, userRoles, userGrants };
|
|
30
|
+
return { login, logout, isAuthenticated, isLoggedIn, userRoles, userGrants };
|
|
28
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sfxcode/nuxt-mongocamp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@nuxt/module-builder": "^0.5.5",
|
|
27
27
|
"@nuxtjs/eslint-config-typescript": "12.1.0",
|
|
28
28
|
"@openapitools/openapi-generator-cli": "^2.9.0",
|
|
29
|
-
"@types/node": "^20.11.
|
|
29
|
+
"@types/node": "^20.11.17",
|
|
30
30
|
"@unocss/nuxt": "^0.58.5",
|
|
31
31
|
"defu": "^6.1.4",
|
|
32
32
|
"jiti": "^1.21.0",
|