una-nuxt-module 3.0.37 → 3.0.38

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "una-nuxt-module",
3
- "version": "3.0.37",
3
+ "version": "3.0.38",
4
4
  "configKey": "unaxt",
5
5
  "compatibility": {
6
6
  "nuxt": ">=4.0.0"
package/dist/module.mjs CHANGED
@@ -167,12 +167,165 @@ function addTemplates() {
167
167
  }
168
168
 
169
169
  const name = "una-nuxt-module";
170
- const version = "3.0.37";
170
+ const version = "3.0.38";
171
+ const description = "Módulo Nuxt para desarrollo CGI";
172
+ const repository = {
173
+ type: "git",
174
+ url: ""
175
+ };
176
+ const license = "MIT";
177
+ const type = "module";
178
+ const exports$1 = {
179
+ ".": {
180
+ types: "./dist/types.d.mts",
181
+ style: "./dist/runtime/styles/main.css",
182
+ "import": "./dist/module.mjs",
183
+ require: "./dist/module.mjs"
184
+ }
185
+ };
186
+ const main = "./dist/module.mjs";
187
+ const typesVersions = {
188
+ "*": {
189
+ ".": [
190
+ "./dist/types.d.mts"
191
+ ],
192
+ "runtime/*": [
193
+ "./dist/runtime/*"
194
+ ],
195
+ "components/*": [
196
+ "./dist/runtime/components/*"
197
+ ]
198
+ }
199
+ };
200
+ const imports = {
201
+ "#build/templates/*": "./.nuxt/templates/*.ts",
202
+ "#build/templates.css": "./.nuxt/templates.css"
203
+ };
204
+ const style = "./dist/runtime/styles/main.css";
205
+ const files = [
206
+ "README.md",
207
+ "LICENSE",
208
+ ".nuxt/templates",
209
+ ".nuxt/templates.css",
210
+ "dist"
211
+ ];
212
+ const scripts = {
213
+ prepack: "nuxt-module-build build",
214
+ dev: "pnpm run dev:prepare && nuxi dev playground",
215
+ "dev:https": "pnpm run dev:prepare && cd playground && pnpm run dev:https",
216
+ "dev:build": "nuxi build playground",
217
+ "dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
218
+ "release:prepare:major": "pnpm run test && pnpm run prepack && changelogen --release --major",
219
+ "release:prepare:minor": "pnpm run test && pnpm run prepack && changelogen --release --minor",
220
+ "release:prepare:patch": "pnpm run test && pnpm run prepack && changelogen --release --patch",
221
+ release: "pnpm publish && git push --follow-tags",
222
+ prepare: "husky",
223
+ format: "prettier --write .",
224
+ lint: "eslint .",
225
+ "lint:fix": "eslint . --fix",
226
+ test: "vitest run",
227
+ "test:watch": "vitest watch",
228
+ "test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
229
+ };
230
+ const dependencies = {
231
+ "@asgardeo/auth-spa": "3.5.2",
232
+ "@nuxt/a11y": "1.0.0-alpha.1",
233
+ "@nuxt/fonts": "0.14.0",
234
+ "@nuxt/hints": "1.1.2",
235
+ "@nuxt/icon": "2.2.3",
236
+ "@nuxt/image": "2.0.0",
237
+ "@nuxt/kit": "4.4.7",
238
+ "@nuxtjs/i18n": "10.4.0",
239
+ "@pinia/nuxt": "0.5.5",
240
+ "@tailwindcss/vite": "4.3.0",
241
+ "@tanstack/vue-table": "8.21.3",
242
+ "@unovis/ts": "1.6.5",
243
+ "@unovis/vue": "1.6.5",
244
+ "@vee-validate/zod": "4.15.1",
245
+ "@vueuse/core": "14.3.0",
246
+ "class-variance-authority": "0.7.1",
247
+ clsx: "2.1.1",
248
+ colorette: "2.0.20",
249
+ defu: "6.1.7",
250
+ "embla-carousel-vue": "8.6.0",
251
+ "lucide-vue-next": "1.0.0",
252
+ "nuxt-security": "2.6.0",
253
+ pinia: "2.2.8",
254
+ "reka-ui": "2.9.9",
255
+ scule: "1.3.0",
256
+ "tailwind-merge": "3.6.0",
257
+ tailwindcss: "4.3.0",
258
+ "tw-animate-css": "1.4.0",
259
+ "vaul-vue": "0.4.1",
260
+ "vee-validate": "4.15.1",
261
+ "vue-input-otp": "0.3.2",
262
+ "vue-sonner": "2.0.9",
263
+ zod: "3.25.76"
264
+ };
265
+ const devDependencies = {
266
+ "@nuxt/devtools": "3.2.4",
267
+ "@nuxt/eslint-config": "1.15.2",
268
+ "@nuxt/module-builder": "1.0.2",
269
+ "@nuxt/schema": "4.4.7",
270
+ "@nuxt/test-utils": "4.0.3",
271
+ "@nuxtjs/color-mode": "4.0.0",
272
+ "@types/node": "24.3.1",
273
+ "@typescript-eslint/parser": "8.60.1",
274
+ changelogen: "0.6.2",
275
+ eslint: "9.39.1",
276
+ "eslint-plugin-security": "3.0.1",
277
+ husky: "9.1.7",
278
+ "lint-staged": "17.0.7",
279
+ nuxt: "4.4.7",
280
+ prettier: "3.8.3",
281
+ "prettier-plugin-tailwindcss": "0.8.0",
282
+ "shadcn-nuxt": "2.7.4",
283
+ typescript: "~5.9.2",
284
+ "unaxt-eslint-config": "0.0.3",
285
+ vitest: "4.1.8",
286
+ "vue-eslint-parser": "10.4.1",
287
+ "vue-tsc": "3.3.3"
288
+ };
289
+ const directories = {
290
+ test: "test"
291
+ };
292
+ const author = "Universidad Nacional - Centro de Gestion Informatica";
293
+ const bugs = {
294
+ url: "https://github.com/una-cgi/una-nuxt-module/issues"
295
+ };
296
+ const homepage = "https://github.com/una-cgi/una-nuxt-module#readme";
297
+ const pkg = {
298
+ name: name,
299
+ version: version,
300
+ description: description,
301
+ repository: repository,
302
+ license: license,
303
+ type: type,
304
+ exports: exports$1,
305
+ main: main,
306
+ typesVersions: typesVersions,
307
+ imports: imports,
308
+ style: style,
309
+ files: files,
310
+ scripts: scripts,
311
+ dependencies: dependencies,
312
+ devDependencies: devDependencies,
313
+ "lint-staged": {
314
+ "*.{js,ts,json,vue}": [
315
+ "prettier --write",
316
+ "eslint --fix"
317
+ ]
318
+ },
319
+ directories: directories,
320
+ author: author,
321
+ bugs: bugs,
322
+ homepage: homepage
323
+ };
171
324
 
172
325
  const module$1 = defineNuxtModule({
173
326
  meta: {
174
- name,
175
- version,
327
+ name: pkg.name,
328
+ version: pkg.version,
176
329
  configKey: "unaxt",
177
330
  compatibility: {
178
331
  nuxt: ">=4.0.0"
@@ -186,7 +339,8 @@ const module$1 = defineNuxtModule({
186
339
  sso: {
187
340
  automaticSignIn: true,
188
341
  signInRedirectUrl: "/auth/sso/login",
189
- signOutRedirectUrl: "/auth/sso/logout"
342
+ signOutRedirectUrl: "/auth/sso/logout",
343
+ postLoginRedirect: "/"
190
344
  },
191
345
  middleware: {
192
346
  authentication: {
@@ -206,7 +360,7 @@ const module$1 = defineNuxtModule({
206
360
  },
207
361
  moduleDependencies: {
208
362
  "nuxt-security": {
209
- version: ">=2.0.0",
363
+ version: `>=${pkg.dependencies["nuxt-security"]}`,
210
364
  optional: true,
211
365
  defaults: {
212
366
  removeLoggers: true
@@ -230,7 +384,7 @@ const module$1 = defineNuxtModule({
230
384
  }
231
385
  },
232
386
  async setup(options, nuxt) {
233
- const logger = useLogger(name);
387
+ const logger = useLogger(pkg.name);
234
388
  const { resolve } = createResolver(import.meta.url);
235
389
  options = defu(nuxt.options.runtimeConfig.public.unaxt, options);
236
390
  nuxt.options.runtimeConfig.public.unaxt = options;
@@ -401,7 +555,7 @@ const module$1 = defineNuxtModule({
401
555
  }
402
556
  try {
403
557
  console.log(banner);
404
- console.log(yellow(bold(`\u279C v${version}
558
+ console.log(yellow(bold(`\u279C v${pkg.version}
405
559
  `)));
406
560
  logger.start(cyan(bold("Registro del m\xF3dulo iniciado...")));
407
561
  const startTime = Date.now();
@@ -67,9 +67,7 @@ export default defineNuxtPlugin(async (nuxtApp) => {
67
67
  nuxtApp.hook("app:created", async () => {
68
68
  try {
69
69
  await auth?.signIn();
70
- await navigateTo(
71
- getPostLoginRedirect(authConfig.sso?.postLoginRedirectUrl)
72
- );
70
+ await navigateTo(getPostLoginRedirect());
73
71
  } catch (error) {
74
72
  console.error("Error procesando callback SSO:", error);
75
73
  }
@@ -1,3 +1,3 @@
1
1
  export declare function isSafePath(path: string): boolean;
2
2
  export declare function savePostLoginRedirect(path: string): void;
3
- export declare function getPostLoginRedirect(fallback?: string): string;
3
+ export declare function getPostLoginRedirect(): string | undefined;
@@ -1,3 +1,4 @@
1
+ import { useRuntimeConfig } from "#app";
1
2
  import { isAuthCallback } from "./isAuthCallback.js";
2
3
  const STORAGE_KEY = "postLoginRedirect";
3
4
  export function isSafePath(path) {
@@ -7,19 +8,29 @@ export function savePostLoginRedirect(path) {
7
8
  if (!import.meta.client) {
8
9
  return;
9
10
  }
11
+ const runtimeConfig = useRuntimeConfig();
12
+ const postLoginRedirect = runtimeConfig.public.unaxt.auth.sso?.postLoginRedirect;
13
+ if (postLoginRedirect !== true) {
14
+ return;
15
+ }
10
16
  if (!isSafePath(path) || isAuthCallback(path)) {
11
17
  return;
12
18
  }
13
19
  sessionStorage.setItem(STORAGE_KEY, path);
14
20
  }
15
- export function getPostLoginRedirect(fallback = "/") {
21
+ export function getPostLoginRedirect() {
16
22
  if (!import.meta.client) {
17
- return fallback;
23
+ return;
24
+ }
25
+ const runtimeConfig = useRuntimeConfig();
26
+ const postLoginRedirect = runtimeConfig.public.unaxt.auth.sso?.postLoginRedirect;
27
+ if (typeof postLoginRedirect === "string") {
28
+ return postLoginRedirect;
18
29
  }
19
30
  const stored = sessionStorage.getItem(STORAGE_KEY);
20
31
  sessionStorage.removeItem(STORAGE_KEY);
21
- if (stored && isSafePath(stored)) {
32
+ if (postLoginRedirect === true && stored && isSafePath(stored)) {
22
33
  return stored;
23
34
  }
24
- return fallback;
35
+ return "/";
25
36
  }
@@ -21,7 +21,7 @@ interface ISSOConfig {
21
21
  /**
22
22
  * URL de redirección final después de completar el login SSO.
23
23
  */
24
- postLoginRedirectUrl: string;
24
+ postLoginRedirect: boolean | string;
25
25
  /**
26
26
  * ID del cliente para la autenticación (OAuth Client Key del Service Provider).
27
27
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "una-nuxt-module",
3
- "version": "3.0.37",
3
+ "version": "3.0.38",
4
4
  "description": "Módulo Nuxt para desarrollo CGI",
5
5
  "repository": {
6
6
  "type": "git",