una-nuxt-module 3.0.22 → 3.0.24

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.22",
3
+ "version": "3.0.24",
4
4
  "configKey": "unaxt",
5
5
  "compatibility": {
6
6
  "nuxt": ">=4.0.0"
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.22";
170
+ const version = "3.0.24";
171
171
 
172
172
  const module$1 = defineNuxtModule({
173
173
  meta: {
@@ -186,7 +186,7 @@ const module$1 = defineNuxtModule({
186
186
  automaticSignIn: true,
187
187
  postLoginRedirectUrl: "/",
188
188
  signInRedirectUrl: "/auth/sso/login",
189
- signOutRedirectUrl: "/auth/sso/login"
189
+ signOutRedirectUrl: "/auth/sso/logout"
190
190
  },
191
191
  middleware: {
192
192
  authentication: {
@@ -323,7 +323,12 @@ const module$1 = defineNuxtModule({
323
323
  nuxt.options.runtimeConfig.public.unaxt,
324
324
  {
325
325
  auth: {
326
- unprotectedPages: ["/401", "/403", "/auth/sso/login"]
326
+ unprotectedPages: [
327
+ "/401",
328
+ "/403",
329
+ "/auth/sso/login",
330
+ "/auth/sso/logout"
331
+ ]
327
332
  }
328
333
  }
329
334
  );
@@ -340,14 +345,19 @@ const module$1 = defineNuxtModule({
340
345
  file: resolve("./runtime/auth/pages/403.vue")
341
346
  },
342
347
  {
343
- name: "ssoCallback",
344
348
  path: "/auth/sso/login",
345
- file: resolve("./runtime/auth/pages/ssoCallback.vue")
349
+ file: resolve("./runtime/auth/pages/login.vue")
350
+ },
351
+ {
352
+ path: "/auth/sso/logout",
353
+ file: resolve("./runtime/auth/pages/logout.vue")
346
354
  }
347
355
  );
348
356
  });
349
357
  logger.ready(
350
- "\u2514\u2500\u2500 " + gray("Rutas registradas: ['/401', '/403', '/auth/sso/login']")
358
+ "\u2514\u2500\u2500 " + gray(
359
+ "Rutas registradas: ['/401', '/403', '/auth/sso/login', '/auth/sso/logout']"
360
+ )
351
361
  );
352
362
  logger.ready(
353
363
  green("M\xF3dulo de autenticaci\xF3n inicializado correctamente")
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <slot />
3
+ </template>
4
+
5
+ <script setup>
6
+ import { useRuntimeConfig } from "#app";
7
+ import { navigateTo } from "#imports";
8
+ import { onMounted } from "vue";
9
+ onMounted(async () => {
10
+ const runtimeConfig = useRuntimeConfig();
11
+ await navigateTo(
12
+ runtimeConfig.public.unaxt.auth.sso?.postLoginRedirectUrl ?? "/"
13
+ );
14
+ });
15
+ </script>
@@ -0,0 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -0,0 +1,15 @@
1
+ <template>
2
+ <slot />
3
+ </template>
4
+
5
+ <script setup>
6
+ import { useRuntimeConfig } from "#app";
7
+ import { navigateTo } from "#imports";
8
+ import { onMounted } from "vue";
9
+ onMounted(async () => {
10
+ const runtimeConfig = useRuntimeConfig();
11
+ await navigateTo(
12
+ runtimeConfig.public.unaxt.auth.sso?.signInRedirectUrl ?? "/"
13
+ );
14
+ });
15
+ </script>
@@ -0,0 +1,13 @@
1
+ declare var __VLS_1: {};
2
+ type __VLS_Slots = {} & {
3
+ default?: (props: typeof __VLS_1) => any;
4
+ };
5
+ declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
9
+ type __VLS_WithSlots<T, S> = T & {
10
+ new (): {
11
+ $slots: S;
12
+ };
13
+ };
@@ -9,16 +9,17 @@ export default defineNuxtPlugin(() => {
9
9
  const auth = AsgardeoSPAClient.getInstance();
10
10
  const runtimeConfig = useRuntimeConfig();
11
11
  const authConfig = runtimeConfig.public.unaxt.auth;
12
- const DEFAULT_SCOPES = ["openid", "profile", "email"];
13
- const scope = authConfig.sso?.scopes !== void 0 ? authConfig.sso?.scopes?.split("|") : DEFAULT_SCOPES;
12
+ const FALLBACK_SCOPES = ["openid", "profile", "email"];
13
+ const origin = window.location.origin;
14
14
  const config = {
15
15
  storage: "localStorage",
16
+ enablePKCE: true,
17
+ sendIdTokenInLogoutRequest: true,
16
18
  baseUrl: authConfig.sso?.baseUrl ?? "",
17
19
  clientID: authConfig.sso?.clientId ?? "",
18
- clientSecret: authConfig.sso?.clientSecret ?? "",
19
- scope,
20
- signInRedirectURL: "https://" + window.location.host + (authConfig.sso?.signInRedirectUrl ?? "/"),
21
- signOutRedirectURL: "https://" + window.location.host + (authConfig.sso?.signOutRedirectUrl ?? "/")
20
+ signInRedirectURL: origin + (authConfig.sso?.signInRedirectUrl ?? "/"),
21
+ signOutRedirectURL: origin + (authConfig.sso?.signOutRedirectUrl ?? "/"),
22
+ scope: authConfig.sso?.scopes !== void 0 ? authConfig.sso?.scopes?.split("|") : FALLBACK_SCOPES
22
23
  };
23
24
  auth?.initialize(config);
24
25
  if (authConfig.sso?.automaticSignIn) {
@@ -26,10 +26,6 @@ interface ISSOConfig {
26
26
  * ID del cliente para la autenticación (OAuth Client Key del Service Provider).
27
27
  */
28
28
  clientId: string;
29
- /**
30
- * OAuth Client Secret del Service Provider)
31
- */
32
- clientSecret: string;
33
29
  /**
34
30
  * URL base del servicio SSO (servidor WSO2).
35
31
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "una-nuxt-module",
3
- "version": "3.0.22",
3
+ "version": "3.0.24",
4
4
  "description": "Módulo Nuxt para desarrollo CGI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,20 +0,0 @@
1
- <template>
2
- <slot />
3
- </template>
4
-
5
- <script setup>
6
- import { useRuntimeConfig, useNuxtApp } from "#app";
7
- import { navigateTo } from "#imports";
8
- import { onMounted } from "vue";
9
- onMounted(async () => {
10
- await new Promise((resolve) => setTimeout(resolve, 300));
11
- const { $isAuthenticated } = useNuxtApp();
12
- const isAuthenticated = await $isAuthenticated();
13
- if (isAuthenticated) {
14
- const runtimeConfig = useRuntimeConfig();
15
- await navigateTo(
16
- runtimeConfig.public.unaxt.auth.sso?.postLoginRedirectUrl ?? "/"
17
- );
18
- }
19
- });
20
- </script>