una-nuxt-module 3.0.18 → 3.0.19

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.18",
3
+ "version": "3.0.19",
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.18";
170
+ const version = "3.0.19";
171
171
 
172
172
  const module$1 = defineNuxtModule({
173
173
  meta: {
@@ -3,11 +3,17 @@
3
3
  </template>
4
4
 
5
5
  <script setup>
6
- import { useRuntimeConfig } from "#app";
6
+ import { useRuntimeConfig, useNuxtApp } from "#app";
7
7
  import { navigateTo } from "#imports";
8
8
  import { onMounted } from "vue";
9
- const runtimeConfig = useRuntimeConfig();
10
- onMounted(() => {
11
- navigateTo(runtimeConfig.public.unaxt.auth.sso?.postLoginRedirectUrl ?? "/");
9
+ onMounted(async () => {
10
+ const { $isAuthenticated } = useNuxtApp();
11
+ const isAuthenticated = await $isAuthenticated();
12
+ if (isAuthenticated) {
13
+ const runtimeConfig = useRuntimeConfig();
14
+ await navigateTo(
15
+ runtimeConfig.public.unaxt.auth.sso?.postLoginRedirectUrl ?? "/"
16
+ );
17
+ }
12
18
  });
13
19
  </script>
@@ -7,11 +7,11 @@ declare const _default: import("#app").Plugin<{
7
7
  /**
8
8
  * Método para iniciar la sesión del usuario en WSO2.
9
9
  */
10
- signIn: () => Promise<void>;
10
+ signIn: () => Promise<import("@asgardeo/auth-spa").BasicUserInfo | undefined>;
11
11
  /**
12
12
  * Método para cerrar la sesión del usuario en WSO2.
13
13
  */
14
- signOut: () => Promise<void>;
14
+ signOut: () => Promise<boolean | undefined>;
15
15
  /**
16
16
  * Método que retorna si el usuario esta autenticado en WSO2.
17
17
  */
@@ -40,11 +40,11 @@ declare const _default: import("#app").Plugin<{
40
40
  /**
41
41
  * Método para iniciar la sesión del usuario en WSO2.
42
42
  */
43
- signIn: () => Promise<void>;
43
+ signIn: () => Promise<import("@asgardeo/auth-spa").BasicUserInfo | undefined>;
44
44
  /**
45
45
  * Método para cerrar la sesión del usuario en WSO2.
46
46
  */
47
- signOut: () => Promise<void>;
47
+ signOut: () => Promise<boolean | undefined>;
48
48
  /**
49
49
  * Método que retorna si el usuario esta autenticado en WSO2.
50
50
  */
@@ -60,13 +60,13 @@ export default defineNuxtPlugin(() => {
60
60
  * Método para iniciar la sesión del usuario en WSO2.
61
61
  */
62
62
  signIn: async () => {
63
- auth?.signIn();
63
+ return await auth?.signIn();
64
64
  },
65
65
  /**
66
66
  * Método para cerrar la sesión del usuario en WSO2.
67
67
  */
68
68
  signOut: async () => {
69
- auth?.signOut();
69
+ return await auth?.signOut();
70
70
  },
71
71
  /**
72
72
  * Método que retorna si el usuario esta autenticado en WSO2.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "una-nuxt-module",
3
- "version": "3.0.18",
3
+ "version": "3.0.19",
4
4
  "description": "Módulo Nuxt para desarrollo CGI",
5
5
  "repository": {
6
6
  "type": "git",