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 +1 -1
- package/dist/module.mjs +16 -6
- package/dist/runtime/auth/pages/login.vue +15 -0
- package/dist/runtime/auth/pages/logout.d.vue.ts +13 -0
- package/dist/runtime/auth/pages/logout.vue +15 -0
- package/dist/runtime/auth/pages/logout.vue.d.ts +13 -0
- package/dist/runtime/auth/plugins/auth.js +7 -6
- package/dist/runtime/types/index.d.ts +0 -4
- package/package.json +1 -1
- package/dist/runtime/auth/pages/ssoCallback.vue +0 -20
- /package/dist/runtime/auth/pages/{ssoCallback.d.vue.ts → login.d.vue.ts} +0 -0
- /package/dist/runtime/auth/pages/{ssoCallback.vue.d.ts → login.vue.d.ts} +0 -0
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.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/
|
|
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: [
|
|
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/
|
|
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(
|
|
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
|
|
13
|
-
const
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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,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>
|
|
File without changes
|
|
File without changes
|