una-nuxt-module 3.0.25 → 3.0.26
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 +39 -37
- package/dist/runtime/types/index.d.ts +9 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -167,7 +167,7 @@ function addTemplates() {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
const name = "una-nuxt-module";
|
|
170
|
-
const version = "3.0.
|
|
170
|
+
const version = "3.0.26";
|
|
171
171
|
|
|
172
172
|
const module$1 = defineNuxtModule({
|
|
173
173
|
meta: {
|
|
@@ -195,6 +195,12 @@ const module$1 = defineNuxtModule({
|
|
|
195
195
|
authorization: {
|
|
196
196
|
global: true
|
|
197
197
|
}
|
|
198
|
+
},
|
|
199
|
+
pages: {
|
|
200
|
+
"/401": true,
|
|
201
|
+
"/403": true,
|
|
202
|
+
"/auth/sso/login": true,
|
|
203
|
+
"/auth/sso/logout": true
|
|
198
204
|
}
|
|
199
205
|
}
|
|
200
206
|
},
|
|
@@ -300,14 +306,14 @@ const module$1 = defineNuxtModule({
|
|
|
300
306
|
(dir) => resolve(`./runtime/${dir}`)
|
|
301
307
|
)
|
|
302
308
|
);
|
|
303
|
-
logger.ready("\u251C\u2500\u2500 " + gray("Stores
|
|
304
|
-
logger.ready("\u251C\u2500\u2500 " + gray("Composables
|
|
309
|
+
logger.ready("\u251C\u2500\u2500 " + gray("Stores"));
|
|
310
|
+
logger.ready("\u251C\u2500\u2500 " + gray("Composables"));
|
|
305
311
|
addPlugin({
|
|
306
312
|
name: "auth",
|
|
307
313
|
src: resolve("./runtime/auth/plugins/auth"),
|
|
308
314
|
mode: "client"
|
|
309
315
|
});
|
|
310
|
-
logger.ready("\u251C\u2500\u2500 " + gray("Plugins
|
|
316
|
+
logger.ready("\u251C\u2500\u2500 " + gray("Plugins"));
|
|
311
317
|
addRouteMiddleware({
|
|
312
318
|
name: "authentication",
|
|
313
319
|
path: resolve("./runtime/auth/middleware/authentication"),
|
|
@@ -318,49 +324,45 @@ const module$1 = defineNuxtModule({
|
|
|
318
324
|
path: resolve("./runtime/auth/middleware/authorization"),
|
|
319
325
|
global: options.auth.middleware?.authorization.global
|
|
320
326
|
});
|
|
321
|
-
logger.ready("\u251C\u2500\u2500 " + gray("Middlewares
|
|
327
|
+
logger.ready("\u251C\u2500\u2500 " + gray("Middlewares"));
|
|
328
|
+
const authPages = [
|
|
329
|
+
{
|
|
330
|
+
name: "401",
|
|
331
|
+
path: "/401",
|
|
332
|
+
file: resolve("./runtime/auth/pages/401.vue")
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
name: "403",
|
|
336
|
+
path: "/403",
|
|
337
|
+
file: resolve("./runtime/auth/pages/403.vue")
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
name: "auth-sso-login",
|
|
341
|
+
path: "/auth/sso/login",
|
|
342
|
+
file: resolve("./runtime/auth/pages/login.vue")
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
name: "auth-sso-logout",
|
|
346
|
+
path: "/auth/sso/logout",
|
|
347
|
+
file: resolve("./runtime/auth/pages/logout.vue")
|
|
348
|
+
}
|
|
349
|
+
];
|
|
350
|
+
const enabledAuthPages = Object.entries(options.auth.pages ?? {}).filter(([, enabled]) => enabled).map(([path]) => path);
|
|
322
351
|
nuxt.options.runtimeConfig.public.unaxt = defu(
|
|
323
352
|
nuxt.options.runtimeConfig.public.unaxt,
|
|
324
353
|
{
|
|
325
354
|
auth: {
|
|
326
|
-
unprotectedPages:
|
|
327
|
-
"/401",
|
|
328
|
-
"/403",
|
|
329
|
-
"/auth/sso/login",
|
|
330
|
-
"/auth/sso/logout"
|
|
331
|
-
]
|
|
355
|
+
unprotectedPages: enabledAuthPages
|
|
332
356
|
}
|
|
333
357
|
}
|
|
334
358
|
);
|
|
335
359
|
extendPages((currentPages) => {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
name: "401",
|
|
339
|
-
path: "/401",
|
|
340
|
-
file: resolve("./runtime/auth/pages/401.vue")
|
|
341
|
-
},
|
|
342
|
-
{
|
|
343
|
-
name: "403",
|
|
344
|
-
path: "/403",
|
|
345
|
-
file: resolve("./runtime/auth/pages/403.vue")
|
|
346
|
-
},
|
|
347
|
-
{
|
|
348
|
-
name: "auth-sso-login",
|
|
349
|
-
path: "/auth/sso/login",
|
|
350
|
-
file: resolve("./runtime/auth/pages/login.vue")
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
name: "auth-sso-logout",
|
|
354
|
-
path: "/auth/sso/logout",
|
|
355
|
-
file: resolve("./runtime/auth/pages/logout.vue")
|
|
356
|
-
}
|
|
360
|
+
const enabledPages = authPages.filter(
|
|
361
|
+
(page) => enabledAuthPages.includes(page.path)
|
|
357
362
|
);
|
|
363
|
+
currentPages.push(...enabledPages);
|
|
358
364
|
});
|
|
359
|
-
logger.ready(
|
|
360
|
-
"\u2514\u2500\u2500 " + gray(
|
|
361
|
-
"Rutas registradas: ['/401', '/403', '/auth/sso/login', '/auth/sso/logout']"
|
|
362
|
-
)
|
|
363
|
-
);
|
|
365
|
+
logger.ready("\u2514\u2500\u2500 " + gray("P\xE1ginas"));
|
|
364
366
|
logger.ready(
|
|
365
367
|
green("M\xF3dulo de autenticaci\xF3n inicializado correctamente")
|
|
366
368
|
);
|
|
@@ -67,6 +67,15 @@ export interface IUnaxtModuleOptions {
|
|
|
67
67
|
global: boolean;
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
+
/**
|
|
71
|
+
* Paginas a usar.
|
|
72
|
+
*/
|
|
73
|
+
pages?: {
|
|
74
|
+
'/401': boolean;
|
|
75
|
+
'/403': boolean;
|
|
76
|
+
'/auth/sso/login': boolean;
|
|
77
|
+
'/auth/sso/logout': boolean;
|
|
78
|
+
};
|
|
70
79
|
};
|
|
71
80
|
}
|
|
72
81
|
/** Tipo de autorización. */
|