una-nuxt-module 2.1.21 → 2.1.23
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/components/ui/auto-form/AutoFormFieldObject.vue +1 -1
- package/dist/runtime/i18n/i18n.config.d.ts +5 -0
- package/dist/runtime/middleware/authentication.js +4 -4
- package/dist/runtime/plugins/auth.js +14 -5
- package/dist/runtime/types/index.d.ts +5 -5
- package/package.json +40 -39
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -20,7 +20,7 @@ const props = defineProps({
|
|
|
20
20
|
fieldName: { type: String, required: true },
|
|
21
21
|
required: { type: Boolean, required: false },
|
|
22
22
|
config: { type: null, required: false },
|
|
23
|
-
schema: { type:
|
|
23
|
+
schema: { type: Object, required: false },
|
|
24
24
|
disabled: { type: Boolean, required: false }
|
|
25
25
|
});
|
|
26
26
|
const shapes = computed(() => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineNuxtRouteMiddleware, useNuxtApp } from "#app";
|
|
2
2
|
import { useAuthorization } from "../composables/useAuthorization.js";
|
|
3
3
|
import { useAuthStore } from "../stores/auth.js";
|
|
4
|
-
import
|
|
4
|
+
import { upperFirst } from "scule";
|
|
5
5
|
export default defineNuxtRouteMiddleware(async (to, from) => {
|
|
6
6
|
if (!import.meta.client) {
|
|
7
7
|
return;
|
|
@@ -21,9 +21,9 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
|
|
|
21
21
|
if (authResponse?.email) {
|
|
22
22
|
const [name, lastName] = authResponse.email.split(".");
|
|
23
23
|
return {
|
|
24
|
-
name:
|
|
25
|
-
lastName:
|
|
26
|
-
fullName:
|
|
24
|
+
name: upperFirst(name),
|
|
25
|
+
lastName: upperFirst(lastName),
|
|
26
|
+
fullName: upperFirst(name) + " " + upperFirst(lastName)
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
};
|
|
@@ -5,11 +5,20 @@ import {
|
|
|
5
5
|
} from "@asgardeo/auth-spa";
|
|
6
6
|
import { useAuthorization } from "../composables/useAuthorization.js";
|
|
7
7
|
import { useAuthStore } from "../stores/auth.js";
|
|
8
|
-
import
|
|
8
|
+
import { upperFirst } from "scule";
|
|
9
9
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
10
10
|
const auth = AsgardeoSPAClient.getInstance();
|
|
11
11
|
const runtimeConfig = useRuntimeConfig();
|
|
12
|
-
const
|
|
12
|
+
const ssoConfig = runtimeConfig.public.unaNuxtModule.sso;
|
|
13
|
+
const config = {
|
|
14
|
+
baseUrl: ssoConfig.baseUrl,
|
|
15
|
+
clientID: ssoConfig.clientId,
|
|
16
|
+
clientSecret: ssoConfig.clientSecret,
|
|
17
|
+
scope: ssoConfig.scope?.split("|") || [],
|
|
18
|
+
signInRedirectURL: ssoConfig.signInRedirectUrl,
|
|
19
|
+
signOutRedirectURL: ssoConfig.signOutRedirectUrl,
|
|
20
|
+
validateIDToken: ssoConfig.validateIdToken
|
|
21
|
+
};
|
|
13
22
|
auth?.initialize(config);
|
|
14
23
|
auth?.signIn();
|
|
15
24
|
auth?.on(Hooks.SignIn, async (response) => {
|
|
@@ -19,9 +28,9 @@ export default defineNuxtPlugin((nuxtApp) => {
|
|
|
19
28
|
if (response?.email) {
|
|
20
29
|
const [name, lastName] = response.email.split(".");
|
|
21
30
|
return {
|
|
22
|
-
name:
|
|
23
|
-
lastName:
|
|
24
|
-
fullName:
|
|
31
|
+
name: upperFirst(name),
|
|
32
|
+
lastName: upperFirst(lastName),
|
|
33
|
+
fullName: upperFirst(name) + " " + upperFirst(lastName)
|
|
25
34
|
};
|
|
26
35
|
}
|
|
27
36
|
};
|
|
@@ -19,15 +19,15 @@ export interface IUnaNuxtModuleOptions {
|
|
|
19
19
|
/**
|
|
20
20
|
* URL de redirección después de iniciar sesión.
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
signInRedirectUrl: string;
|
|
23
23
|
/**
|
|
24
24
|
* URL de redirección después de cerrar sesión.
|
|
25
25
|
*/
|
|
26
|
-
|
|
26
|
+
signOutRedirectUrl: string;
|
|
27
27
|
/**
|
|
28
28
|
* ID del cliente para la autenticación (OAuth Client Key del Service Provider).
|
|
29
29
|
*/
|
|
30
|
-
|
|
30
|
+
clientId: string;
|
|
31
31
|
/**
|
|
32
32
|
* OAuth Client Secret del Service Provider)
|
|
33
33
|
*/
|
|
@@ -39,11 +39,11 @@ export interface IUnaNuxtModuleOptions {
|
|
|
39
39
|
/**
|
|
40
40
|
* Lista de permisos o alcances solicitados.
|
|
41
41
|
*/
|
|
42
|
-
scope:
|
|
42
|
+
scope: string;
|
|
43
43
|
/**
|
|
44
44
|
* Indica si se debe validar el IDToken.
|
|
45
45
|
*/
|
|
46
|
-
|
|
46
|
+
validateIdToken?: boolean;
|
|
47
47
|
};
|
|
48
48
|
/**
|
|
49
49
|
* Configuración de las APIs utilizadas por el módulo.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "una-nuxt-module",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.23",
|
|
4
4
|
"description": "Módulo Nuxt para desarrollo CGI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -57,48 +57,49 @@
|
|
|
57
57
|
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@asgardeo/auth-spa": "
|
|
61
|
-
"@nuxt/fonts": "
|
|
60
|
+
"@asgardeo/auth-spa": "3.3.0",
|
|
61
|
+
"@nuxt/fonts": "0.11.4",
|
|
62
62
|
"@nuxt/icon": "2.0.0",
|
|
63
|
-
"@nuxt/image": "
|
|
64
|
-
"@nuxt/kit": "
|
|
65
|
-
"@nuxtjs/i18n": "
|
|
66
|
-
"@tailwindcss/vite": "
|
|
67
|
-
"@tanstack/vue-table": "
|
|
68
|
-
"@vee-validate/zod": "
|
|
69
|
-
"@vueuse/core": "
|
|
70
|
-
"class-variance-authority": "
|
|
71
|
-
"clsx": "
|
|
72
|
-
"defu": "
|
|
73
|
-
"embla-carousel-vue": "
|
|
74
|
-
"lucide-vue-next": "
|
|
75
|
-
"pinia": "
|
|
76
|
-
"reka-ui": "
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"vue-
|
|
84
|
-
"
|
|
63
|
+
"@nuxt/image": "1.11.0",
|
|
64
|
+
"@nuxt/kit": "4.1.1",
|
|
65
|
+
"@nuxtjs/i18n": "10.1.0",
|
|
66
|
+
"@tailwindcss/vite": "4.1.13",
|
|
67
|
+
"@tanstack/vue-table": "8.21.3",
|
|
68
|
+
"@vee-validate/zod": "4.15.1",
|
|
69
|
+
"@vueuse/core": "13.9.0",
|
|
70
|
+
"class-variance-authority": "0.7.1",
|
|
71
|
+
"clsx": "2.1.1",
|
|
72
|
+
"defu": "6.1.4",
|
|
73
|
+
"embla-carousel-vue": "8.6.0",
|
|
74
|
+
"lucide-vue-next": "0.543.0",
|
|
75
|
+
"pinia": "2.2.8",
|
|
76
|
+
"reka-ui": "2.5.0",
|
|
77
|
+
"scule": "1.3.0",
|
|
78
|
+
"tailwind-merge": "3.3.1",
|
|
79
|
+
"tailwindcss": "4.1.13",
|
|
80
|
+
"tw-animate-css": "1.3.8",
|
|
81
|
+
"vaul-vue": "0.4.1",
|
|
82
|
+
"vee-validate": "4.15.1",
|
|
83
|
+
"vue-json-pretty": "2.5.0",
|
|
84
|
+
"vue-sonner": "2.0.8",
|
|
85
|
+
"zod": "3.25.63"
|
|
85
86
|
},
|
|
86
87
|
"devDependencies": {
|
|
87
|
-
"@nuxt/devtools": "
|
|
88
|
-
"@nuxt/eslint-config": "
|
|
89
|
-
"@nuxt/module-builder": "
|
|
90
|
-
"@nuxt/schema": "
|
|
91
|
-
"@nuxt/test-utils": "
|
|
92
|
-
"@
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
88
|
+
"@nuxt/devtools": "2.6.3",
|
|
89
|
+
"@nuxt/eslint-config": "1.9.0",
|
|
90
|
+
"@nuxt/module-builder": "1.0.2",
|
|
91
|
+
"@nuxt/schema": "4.1.1",
|
|
92
|
+
"@nuxt/test-utils": "3.19.2",
|
|
93
|
+
"@nuxtjs/color-mode": "3.5.2",
|
|
94
|
+
"@pinia/nuxt": "0.5.5",
|
|
95
|
+
"@types/node": "24.3.1",
|
|
96
|
+
"changelogen": "0.6.2",
|
|
97
|
+
"eslint": "9.35.0",
|
|
98
|
+
"nuxt": "4.1.1",
|
|
99
|
+
"shadcn-nuxt": "2.2.0",
|
|
96
100
|
"typescript": "~5.9.2",
|
|
97
|
-
"vitest": "
|
|
98
|
-
"vue-tsc": "
|
|
99
|
-
"@nuxtjs/color-mode": "^3.5.2",
|
|
100
|
-
"@pinia/nuxt": "^0.5.2",
|
|
101
|
-
"shadcn-nuxt": "2.2.0"
|
|
101
|
+
"vitest": "3.2.4",
|
|
102
|
+
"vue-tsc": "3.0.6"
|
|
102
103
|
},
|
|
103
104
|
"directories": {
|
|
104
105
|
"test": "test"
|