una-nuxt-module 2.0.1 → 2.0.2
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 +1 -1
- package/dist/runtime/composables/useAuthorization.d.ts +2 -2
- package/dist/runtime/i18n/i18n.config.d.ts +5 -0
- package/dist/runtime/middleware/authentication.d.ts +1 -1
- package/dist/runtime/middleware/authorization.d.ts +1 -1
- package/dist/runtime/plugins/auth.d.ts +1 -59
- package/dist/runtime/plugins/auth.js +0 -4
- package/dist/runtime/plugins/vue-json.d.ts +1 -1
- package/dist/runtime/stores/auth.d.ts +1 -1
- package/dist/runtime/types/index.d.ts +0 -4
- package/package.json +3 -3
- package/dist/runtime/utils/stringToBoolean.d.ts +0 -11
- package/dist/runtime/utils/stringToBoolean.js +0 -4
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { createResolver, defineNuxtModule, useLogger, extendPages, addLayout, ad
|
|
|
2
2
|
import { defu } from 'defu';
|
|
3
3
|
|
|
4
4
|
const name = "una-nuxt-module";
|
|
5
|
-
const version = "2.0.
|
|
5
|
+
const version = "2.0.2";
|
|
6
6
|
|
|
7
7
|
function resolve(path) {
|
|
8
8
|
const resolver = createResolver(import.meta.url);
|
|
@@ -11,7 +11,7 @@ export declare const useAuthorization: () => {
|
|
|
11
11
|
isPageUnprotected: (page: string) => boolean;
|
|
12
12
|
hasAuthorizationIn: (params: IHasAuthorizationInResourceParams) => boolean;
|
|
13
13
|
getAuthorizedPaths: () => ({
|
|
14
|
-
header:
|
|
14
|
+
header: any;
|
|
15
15
|
title?: string;
|
|
16
16
|
icon?: string;
|
|
17
17
|
to?: string;
|
|
@@ -20,7 +20,7 @@ export declare const useAuthorization: () => {
|
|
|
20
20
|
disabled?: boolean;
|
|
21
21
|
description?: string;
|
|
22
22
|
} | {
|
|
23
|
-
title:
|
|
23
|
+
title: any;
|
|
24
24
|
header?: string;
|
|
25
25
|
icon?: string;
|
|
26
26
|
to?: string;
|
|
@@ -8,63 +8,5 @@
|
|
|
8
8
|
const { $isAuthenticated, $authData } = useNuxtApp();
|
|
9
9
|
* ```
|
|
10
10
|
*/
|
|
11
|
-
declare const _default:
|
|
12
|
-
/**
|
|
13
|
-
* Método para cerrar la sesión del usuario en WSO2.
|
|
14
|
-
*/
|
|
15
|
-
signOut: () => Promise<void>;
|
|
16
|
-
/**
|
|
17
|
-
* Método si el usuario esta autenticado en WSO2.
|
|
18
|
-
*/
|
|
19
|
-
isAuthenticated: () => Promise<boolean | undefined>;
|
|
20
|
-
/**
|
|
21
|
-
* Método que retorna la informacion de la sesión del usuario.
|
|
22
|
-
*/
|
|
23
|
-
authData: () => Promise<import("@asgardeo/auth-spa").BasicUserInfo | undefined>;
|
|
24
|
-
/**
|
|
25
|
-
* Método que retorna el ID Token decodificado.
|
|
26
|
-
*/
|
|
27
|
-
decodedIDToken: () => Promise<import("@asgardeo/auth-spa").DecodedIDTokenPayload | undefined>;
|
|
28
|
-
/**
|
|
29
|
-
* Método que retorna el Access Token del usuario.
|
|
30
|
-
*/
|
|
31
|
-
accessToken: () => Promise<string | undefined>;
|
|
32
|
-
/**
|
|
33
|
-
* Método que retorna el ID Token.
|
|
34
|
-
*/
|
|
35
|
-
getIDToken: () => Promise<string | undefined>;
|
|
36
|
-
/**
|
|
37
|
-
* Método que retorna los endpoints de OpenId Connect.
|
|
38
|
-
*/
|
|
39
|
-
OIDCServiceEndpoints: () => Promise<import("@asgardeo/auth-spa").OIDCEndpoints | undefined>;
|
|
40
|
-
}> & import("#app").ObjectPlugin<{
|
|
41
|
-
/**
|
|
42
|
-
* Método para cerrar la sesión del usuario en WSO2.
|
|
43
|
-
*/
|
|
44
|
-
signOut: () => Promise<void>;
|
|
45
|
-
/**
|
|
46
|
-
* Método si el usuario esta autenticado en WSO2.
|
|
47
|
-
*/
|
|
48
|
-
isAuthenticated: () => Promise<boolean | undefined>;
|
|
49
|
-
/**
|
|
50
|
-
* Método que retorna la informacion de la sesión del usuario.
|
|
51
|
-
*/
|
|
52
|
-
authData: () => Promise<import("@asgardeo/auth-spa").BasicUserInfo | undefined>;
|
|
53
|
-
/**
|
|
54
|
-
* Método que retorna el ID Token decodificado.
|
|
55
|
-
*/
|
|
56
|
-
decodedIDToken: () => Promise<import("@asgardeo/auth-spa").DecodedIDTokenPayload | undefined>;
|
|
57
|
-
/**
|
|
58
|
-
* Método que retorna el Access Token del usuario.
|
|
59
|
-
*/
|
|
60
|
-
accessToken: () => Promise<string | undefined>;
|
|
61
|
-
/**
|
|
62
|
-
* Método que retorna el ID Token.
|
|
63
|
-
*/
|
|
64
|
-
getIDToken: () => Promise<string | undefined>;
|
|
65
|
-
/**
|
|
66
|
-
* Método que retorna los endpoints de OpenId Connect.
|
|
67
|
-
*/
|
|
68
|
-
OIDCServiceEndpoints: () => Promise<import("@asgardeo/auth-spa").OIDCEndpoints | undefined>;
|
|
69
|
-
}>;
|
|
11
|
+
declare const _default: any;
|
|
70
12
|
export default _default;
|
|
@@ -4,14 +4,10 @@ import {
|
|
|
4
4
|
Hooks
|
|
5
5
|
} from "@asgardeo/auth-spa";
|
|
6
6
|
import { useAuthorization, useAuthStore } from "#imports";
|
|
7
|
-
import stringToBoolean from "../utils/stringToBoolean.js";
|
|
8
7
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
9
8
|
const auth = AsgardeoSPAClient.getInstance();
|
|
10
9
|
const runtimeConfig = useRuntimeConfig();
|
|
11
10
|
const config = runtimeConfig.public.unaNuxtModule.sso;
|
|
12
|
-
if (typeof config.validateIDToken === "string") {
|
|
13
|
-
config.validateIDToken = stringToBoolean(config.validateIDToken);
|
|
14
|
-
}
|
|
15
11
|
auth?.initialize(config);
|
|
16
12
|
auth?.signIn();
|
|
17
13
|
auth?.on(Hooks.SignIn, async (response) => {
|
|
@@ -45,7 +45,7 @@ export declare const useAuthStore: import("pinia").StoreDefinition<"AuthStore",
|
|
|
45
45
|
update: (userInfo: IAuthenticatedUser, data: IAuthData) => void;
|
|
46
46
|
hasResource: (resource: string) => boolean;
|
|
47
47
|
hasAuthorizationInResource: ({ resource, authorization, }: IHasAuthorizationInResourceParams) => boolean;
|
|
48
|
-
}, "
|
|
48
|
+
}, "user" | "authData">, Pick<{
|
|
49
49
|
user: import("vue").Ref<{
|
|
50
50
|
email: string;
|
|
51
51
|
fullName: string;
|
|
@@ -40,10 +40,6 @@ export interface IUnaNuxtModuleOptions {
|
|
|
40
40
|
* Lista de permisos o alcances solicitados.
|
|
41
41
|
*/
|
|
42
42
|
scope: String[];
|
|
43
|
-
/**
|
|
44
|
-
* Indica si se debe validar el IDToken.
|
|
45
|
-
*/
|
|
46
|
-
validateIDToken: string;
|
|
47
43
|
};
|
|
48
44
|
/**
|
|
49
45
|
* Configuración de las APIs utilizadas por el módulo.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "una-nuxt-module",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Módulo Nuxt para desarrollo CGI",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@asgardeo/auth-spa": "^3.
|
|
35
|
+
"@asgardeo/auth-spa": "^3.2.0",
|
|
36
36
|
"@nuxt/image": "^1.10.0",
|
|
37
37
|
"@nuxt/kit": "^3.16.1",
|
|
38
|
-
"@nuxtjs/i18n": "9.
|
|
38
|
+
"@nuxtjs/i18n": "9.5.3",
|
|
39
39
|
"defu": "^6.1.4",
|
|
40
40
|
"pinia": "^3.0.1",
|
|
41
41
|
"vue-json-pretty": "^2.4.0",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convierte una cadena de texto a un valor booleano.
|
|
3
|
-
*
|
|
4
|
-
* - Retorna `true` si el texto es `"true"` (sin distinción de mayúsculas o minúsculas).
|
|
5
|
-
* - Cualquier otro valor (incluidos nulos o indefinidos) será convertido a `false`.
|
|
6
|
-
*
|
|
7
|
-
* @param {string} value - Texto a convertir.
|
|
8
|
-
* @returns {boolean}
|
|
9
|
-
*/
|
|
10
|
-
declare const _default: (value: string) => boolean;
|
|
11
|
-
export default _default;
|