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
package/dist/module.mjs
CHANGED
|
@@ -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
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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<
|
|
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<
|
|
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<
|
|
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<
|
|
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.
|