@merkaly/nuxt 0.2.1 → 0.2.3
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/runtime/components/format/FormatMoney.d.vue.ts +1 -1
- package/dist/runtime/components/format/FormatMoney.vue.d.ts +1 -1
- package/dist/runtime/components/input/InputAddress.d.vue.ts +1 -1
- package/dist/runtime/components/input/InputAddress.vue.d.ts +1 -1
- package/dist/runtime/components/input/InputMoney.d.vue.ts +2 -2
- package/dist/runtime/components/input/InputMoney.vue.d.ts +2 -2
- package/dist/runtime/plugins/auth0.client.js +25 -3
- package/package.json +3 -3
package/dist/module.json
CHANGED
|
@@ -61,10 +61,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
61
61
|
mode: keyof Intl.NumberFormatOptionsStyleRegistry;
|
|
62
62
|
base: number;
|
|
63
63
|
tag: string;
|
|
64
|
+
value: number;
|
|
64
65
|
currency: string;
|
|
65
66
|
hideDecimal: boolean;
|
|
66
67
|
locale: string;
|
|
67
|
-
value: number;
|
|
68
68
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
69
69
|
declare const _default: typeof __VLS_export;
|
|
70
70
|
export default _default;
|
|
@@ -61,10 +61,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
61
61
|
mode: keyof Intl.NumberFormatOptionsStyleRegistry;
|
|
62
62
|
base: number;
|
|
63
63
|
tag: string;
|
|
64
|
+
value: number;
|
|
64
65
|
currency: string;
|
|
65
66
|
hideDecimal: boolean;
|
|
66
67
|
locale: string;
|
|
67
|
-
value: number;
|
|
68
68
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
69
69
|
declare const _default: typeof __VLS_export;
|
|
70
70
|
export default _default;
|
|
@@ -81,8 +81,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
81
81
|
}>, {
|
|
82
82
|
mode: PlaceTypes;
|
|
83
83
|
disabled: boolean;
|
|
84
|
-
countries: string[];
|
|
85
84
|
placeholder: string;
|
|
85
|
+
countries: string[];
|
|
86
86
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
87
87
|
declare const _default: typeof __VLS_export;
|
|
88
88
|
export default _default;
|
|
@@ -81,8 +81,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
81
81
|
}>, {
|
|
82
82
|
mode: PlaceTypes;
|
|
83
83
|
disabled: boolean;
|
|
84
|
-
countries: string[];
|
|
85
84
|
placeholder: string;
|
|
85
|
+
countries: string[];
|
|
86
86
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
87
87
|
declare const _default: typeof __VLS_export;
|
|
88
88
|
export default _default;
|
|
@@ -75,10 +75,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
75
75
|
"onUpdate:modelValue"?: ((value: Numberish) => any) | undefined;
|
|
76
76
|
}>, {
|
|
77
77
|
prefix: string;
|
|
78
|
-
decimal: string;
|
|
79
|
-
placeholder: string;
|
|
80
78
|
max: number;
|
|
81
79
|
min: number;
|
|
80
|
+
placeholder: string;
|
|
81
|
+
decimal: string;
|
|
82
82
|
precision: number;
|
|
83
83
|
suffix: string;
|
|
84
84
|
thousands: string;
|
|
@@ -75,10 +75,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
75
75
|
"onUpdate:modelValue"?: ((value: Numberish) => any) | undefined;
|
|
76
76
|
}>, {
|
|
77
77
|
prefix: string;
|
|
78
|
-
decimal: string;
|
|
79
|
-
placeholder: string;
|
|
80
78
|
max: number;
|
|
81
79
|
min: number;
|
|
80
|
+
placeholder: string;
|
|
81
|
+
decimal: string;
|
|
82
82
|
precision: number;
|
|
83
83
|
suffix: string;
|
|
84
84
|
thousands: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createAuth0Client } from "@auth0/auth0-spa-js";
|
|
2
|
-
import { defineNuxtPlugin, useRuntimeConfig } from "#imports";
|
|
2
|
+
import { defineNuxtPlugin, useRuntimeConfig, useNuxtApp } from "#imports";
|
|
3
3
|
import { navigateTo } from "#app";
|
|
4
4
|
import { defu } from "defu";
|
|
5
5
|
import { useAuth } from "../composables/useAuth.js";
|
|
@@ -16,19 +16,41 @@ export default defineNuxtPlugin(async ({ callHook, hook }) => {
|
|
|
16
16
|
auth0.getUser = () => self0.getUser().then((result) => user.value = result).catch((reason) => console.error("[Auth0] getUser failed", reason));
|
|
17
17
|
auth0.getTokenSilently = (options = {}) => self0.getTokenSilently(defu({ authorizationParams: { audience: $config.merkaly.auth0.audience } }, options)).then((result) => token.value = result).catch((err) => console.warn("[Auth0] getTokenSilently failed \u2013 fallback, user logged in?", err));
|
|
18
18
|
auth0.handleRedirectCallback = () => self0.handleRedirectCallback().then(({ appState }) => Promise.allSettled([auth0.getUser(), auth0.getTokenSilently()]).then(() => void navigateTo(appState?.target || "/"))).catch(() => navigateTo("/"));
|
|
19
|
-
auth0.loginWithRedirect = () => self0.loginWithRedirect({
|
|
19
|
+
auth0.loginWithRedirect = (options = {}) => self0.loginWithRedirect(defu(options, {
|
|
20
20
|
authorizationParams: {
|
|
21
21
|
audience: $config.merkaly.auth0.audience,
|
|
22
22
|
redirect_uri: URL.canParse($config.merkaly.auth0.callbackUrl) ? $config.merkaly.auth0.callbackUrl : location.origin.concat($config.merkaly.auth0.callbackUrl),
|
|
23
23
|
scope: "openid profile email offline_access"
|
|
24
24
|
// necesario aquí para API
|
|
25
25
|
}
|
|
26
|
-
});
|
|
26
|
+
}));
|
|
27
27
|
auth0.logout = () => self0.logout({
|
|
28
28
|
logoutParams: {
|
|
29
29
|
returnTo: URL.canParse($config.merkaly.auth0.logoutUrl) ? $config.merkaly.auth0.logoutUrl : location.origin.concat($config.merkaly.auth0.logoutUrl)
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
+
const callbackUrl = $config.merkaly.auth0.callbackUrl;
|
|
33
|
+
const redirectUri = URL.canParse(callbackUrl) ? callbackUrl : `${location.origin}${callbackUrl}`;
|
|
34
|
+
const linkingClient = await createAuth0Client({
|
|
35
|
+
cacheLocation: "memory",
|
|
36
|
+
clientId: "AwD3uBHhLhFBbJhwSWXYFh9cZYidNc6L",
|
|
37
|
+
domain: $config.merkaly.auth0.domain,
|
|
38
|
+
authorizationParams: {
|
|
39
|
+
redirect_uri: redirectUri
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
auth0.linkWithConnection = (connection) => {
|
|
43
|
+
return linkingClient.loginWithPopup({ authorizationParams: { connection } }).then(() => linkingClient.getIdTokenClaims()).then((claims) => {
|
|
44
|
+
if (!claims?.sub) {
|
|
45
|
+
throw new Error("Failed to get ID token for linking");
|
|
46
|
+
}
|
|
47
|
+
const [provider, ...userIdParts] = claims.sub.split("|");
|
|
48
|
+
const userId = userIdParts.join("|");
|
|
49
|
+
const body = { provider, userId };
|
|
50
|
+
const { $api } = useNuxtApp();
|
|
51
|
+
return $api("/identities", { method: "POST", prefix: "/", body });
|
|
52
|
+
});
|
|
53
|
+
};
|
|
32
54
|
Promise.allSettled([auth0.getUser(), auth0.getTokenSilently()]).then(() => hook("app:created", () => callHook("merkaly:auth", user.value))).catch(() => void 0).finally(() => isLoading.value = false);
|
|
33
55
|
return { provide: { auth0 } };
|
|
34
56
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@merkaly/nuxt",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/merkaly-io/nuxt.git"
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@types/node": "latest",
|
|
41
41
|
"@types/vue-select": "^3.16.8",
|
|
42
42
|
"@vueuse/components": "^14.1.0",
|
|
43
|
-
"@vueuse/core": "^14.
|
|
43
|
+
"@vueuse/core": "^14.2.0",
|
|
44
44
|
"@vueuse/integrations": "^14.2.0",
|
|
45
|
-
"@vueuse/nuxt": "^14.
|
|
45
|
+
"@vueuse/nuxt": "^14.2.0",
|
|
46
46
|
"bootstrap": "^5.3.8",
|
|
47
47
|
"bootstrap-vue-next": "^0.42.0",
|
|
48
48
|
"change-case": "^5",
|