@merkaly/nuxt 0.4.1 → 0.4.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/runtime/components/auth.vue +4 -12
- package/dist/runtime/components/format/FormatMoney.d.vue.ts +3 -3
- package/dist/runtime/components/format/FormatMoney.vue.d.ts +3 -3
- 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 +1 -1
- package/dist/runtime/components/input/InputMoney.vue.d.ts +1 -1
- package/dist/runtime/middleware/auth.js +2 -1
- package/dist/runtime/plugins/auth0.client.js +2 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -24,18 +24,10 @@ function handleCode() {
|
|
|
24
24
|
return void $auth0.handleRedirectCallback().then(() => emit("success"));
|
|
25
25
|
}
|
|
26
26
|
callOnce(async () => {
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return handleError();
|
|
32
|
-
}
|
|
33
|
-
if (code) {
|
|
34
|
-
return handleCode();
|
|
35
|
-
}
|
|
36
|
-
return $auth0.loginWithRedirect({
|
|
37
|
-
appState: { target: redirect || "/" }
|
|
38
|
-
});
|
|
27
|
+
if (error) return handleError();
|
|
28
|
+
if (code) return handleCode();
|
|
29
|
+
if (invitation && organization) return handleInvite();
|
|
30
|
+
return $auth0.loginWithRedirect({ appState: { target: redirect || "/" } });
|
|
39
31
|
});
|
|
40
32
|
</script>
|
|
41
33
|
|
|
@@ -59,11 +59,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
59
59
|
};
|
|
60
60
|
}>> & Readonly<{}>, {
|
|
61
61
|
mode: keyof Intl.NumberFormatOptionsStyleRegistry;
|
|
62
|
-
base: number;
|
|
63
|
-
tag: string;
|
|
64
|
-
value: number;
|
|
65
62
|
currency: string;
|
|
63
|
+
base: number;
|
|
66
64
|
locale: string;
|
|
65
|
+
value: number;
|
|
66
|
+
tag: string;
|
|
67
67
|
hideDecimal: boolean;
|
|
68
68
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
69
69
|
declare const _default: typeof __VLS_export;
|
|
@@ -59,11 +59,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
59
59
|
};
|
|
60
60
|
}>> & Readonly<{}>, {
|
|
61
61
|
mode: keyof Intl.NumberFormatOptionsStyleRegistry;
|
|
62
|
-
base: number;
|
|
63
|
-
tag: string;
|
|
64
|
-
value: number;
|
|
65
62
|
currency: string;
|
|
63
|
+
base: number;
|
|
66
64
|
locale: string;
|
|
65
|
+
value: number;
|
|
66
|
+
tag: string;
|
|
67
67
|
hideDecimal: boolean;
|
|
68
68
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
69
69
|
declare const _default: typeof __VLS_export;
|
|
@@ -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
|
-
placeholder: string;
|
|
85
84
|
countries: string[];
|
|
85
|
+
placeholder: 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
|
-
placeholder: string;
|
|
85
84
|
countries: string[];
|
|
85
|
+
placeholder: string;
|
|
86
86
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
87
87
|
declare const _default: typeof __VLS_export;
|
|
88
88
|
export default _default;
|
|
@@ -74,11 +74,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
74
74
|
}>> & Readonly<{
|
|
75
75
|
"onUpdate:modelValue"?: ((value: Numberish) => any) | undefined;
|
|
76
76
|
}>, {
|
|
77
|
+
decimal: string;
|
|
77
78
|
min: number;
|
|
78
79
|
max: number;
|
|
79
80
|
prefix: string;
|
|
80
81
|
placeholder: string;
|
|
81
|
-
decimal: string;
|
|
82
82
|
precision: number;
|
|
83
83
|
suffix: string;
|
|
84
84
|
thousands: string;
|
|
@@ -74,11 +74,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
74
74
|
}>> & Readonly<{
|
|
75
75
|
"onUpdate:modelValue"?: ((value: Numberish) => any) | undefined;
|
|
76
76
|
}>, {
|
|
77
|
+
decimal: string;
|
|
77
78
|
min: number;
|
|
78
79
|
max: number;
|
|
79
80
|
prefix: string;
|
|
80
81
|
placeholder: string;
|
|
81
|
-
decimal: string;
|
|
82
82
|
precision: number;
|
|
83
83
|
suffix: string;
|
|
84
84
|
thousands: string;
|
|
@@ -3,10 +3,11 @@ import { useAuth } from "../composables/useAuth.js";
|
|
|
3
3
|
export default defineNuxtRouteMiddleware((to) => {
|
|
4
4
|
const { isLoading, isAuthenticated } = useAuth();
|
|
5
5
|
const { public: { merkaly } } = useRuntimeConfig();
|
|
6
|
+
const callbackPath = URL.canParse(merkaly.auth0.callbackUrl) ? new URL(merkaly.auth0.callbackUrl).pathname : merkaly.auth0.callbackUrl;
|
|
6
7
|
if (isLoading.value) {
|
|
7
8
|
return;
|
|
8
9
|
}
|
|
9
|
-
if (to.path ===
|
|
10
|
+
if (to.path === callbackPath) {
|
|
10
11
|
return;
|
|
11
12
|
}
|
|
12
13
|
const requiresAuth = typeof to.meta.requiresAuth === "boolean" ? to.meta.requiresAuth : merkaly.auth0.requiresAuth;
|
|
@@ -5,6 +5,7 @@ import { defu } from "defu";
|
|
|
5
5
|
import { useAuth } from "../composables/useAuth.js";
|
|
6
6
|
export default defineNuxtPlugin(async ({ callHook, hook }) => {
|
|
7
7
|
const { public: $config } = useRuntimeConfig();
|
|
8
|
+
const callbackPath = URL.canParse($config.merkaly.auth0.callbackUrl) ? new URL($config.merkaly.auth0.callbackUrl).pathname : $config.merkaly.auth0.callbackUrl;
|
|
8
9
|
const auth0 = await createAuth0Client({
|
|
9
10
|
cacheLocation: "localstorage",
|
|
10
11
|
clientId: $config.merkaly.auth0.client,
|
|
@@ -51,7 +52,7 @@ export default defineNuxtPlugin(async ({ callHook, hook }) => {
|
|
|
51
52
|
return $api("/identities", { method: "POST", prefix: "/", body });
|
|
52
53
|
});
|
|
53
54
|
};
|
|
54
|
-
const isAuthCallback = window.location.pathname ===
|
|
55
|
+
const isAuthCallback = window.location.pathname === callbackPath;
|
|
55
56
|
if (!isAuthCallback) {
|
|
56
57
|
await Promise.allSettled([auth0.getUser(), auth0.getTokenSilently()]).then(() => hook("app:created", () => callHook("merkaly:auth", user.value))).catch(() => void 0);
|
|
57
58
|
}
|