@witchcraft/nuxt-auth 0.5.1 → 0.6.0-beta.1
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/README.md +189 -337
- package/dist/module.d.mts +64 -41
- package/dist/module.json +1 -1
- package/dist/module.mjs +25 -35
- package/dist/runtime/components/ExternalCallback.vue +11 -11
- package/dist/runtime/components/LoginProviderButtons.client.d.vue.ts +10 -15
- package/dist/runtime/components/LoginProviderButtons.client.vue +12 -11
- package/dist/runtime/components/LoginProviderButtons.client.vue.d.ts +10 -15
- package/dist/runtime/components/MockBypassRegistrationFields.d.vue.ts +13 -0
- package/dist/runtime/components/MockBypassRegistrationFields.vue +18 -0
- package/dist/runtime/components/MockBypassRegistrationFields.vue.d.ts +13 -0
- package/dist/runtime/components/Mocker.d.vue.ts +5 -1
- package/dist/runtime/components/Mocker.vue +7 -10
- package/dist/runtime/components/Mocker.vue.d.ts +5 -1
- package/dist/runtime/components/SessionStatus.d.vue.ts +86 -42
- package/dist/runtime/components/SessionStatus.vue +29 -8
- package/dist/runtime/components/SessionStatus.vue.d.ts +86 -42
- package/dist/runtime/components/UserRegistration.d.vue.ts +5 -0
- package/dist/runtime/components/UserRegistration.vue +2 -0
- package/dist/runtime/components/UserRegistration.vue.d.ts +5 -0
- package/dist/runtime/composables/useAuth.d.ts +382 -19
- package/dist/runtime/composables/useAuth.js +191 -28
- package/dist/runtime/composables/useAuthExternalCallback.d.ts +13 -6
- package/dist/runtime/composables/useAuthExternalCallback.js +27 -16
- package/dist/runtime/composables/useAuthExternalCode.d.ts +2 -2
- package/dist/runtime/composables/useAuthExternalCode.js +19 -18
- package/dist/runtime/composables/useAuthMocker.d.ts +11 -1
- package/dist/runtime/composables/useAuthMocker.js +21 -11
- package/dist/runtime/composables/useAuthUserRegistration.d.ts +5 -10
- package/dist/runtime/composables/useAuthUserRegistration.js +12 -25
- package/dist/runtime/core/providerStyles.js +12 -4
- package/dist/runtime/electron/index.d.ts +1 -0
- package/dist/runtime/electron/index.js +1 -0
- package/dist/runtime/electron/main/ElectronAuth.d.ts +123 -0
- package/dist/runtime/electron/main/ElectronAuth.js +200 -0
- package/dist/runtime/electron/main/index.d.ts +2 -0
- package/dist/runtime/electron/main/index.js +2 -0
- package/dist/runtime/electron/main/setupElectronAuthMain.d.ts +665 -0
- package/dist/runtime/electron/main/setupElectronAuthMain.js +137 -0
- package/dist/runtime/electron/preload/createElectronAuthApi.d.ts +7 -0
- package/dist/runtime/electron/preload/createElectronAuthApi.js +15 -0
- package/dist/runtime/electron/preload/index.d.ts +2 -0
- package/dist/runtime/electron/preload/index.js +2 -0
- package/dist/runtime/electron/types.d.ts +54 -0
- package/dist/runtime/electron/types.js +2 -0
- package/dist/runtime/middleware/authGlobal.js +30 -14
- package/dist/runtime/middleware/authProtected.js +2 -2
- package/dist/runtime/plugins/client/electronNuxtAuthPlugin.d.ts +48 -0
- package/dist/runtime/plugins/client/electronNuxtAuthPlugin.js +86 -0
- package/dist/runtime/plugins/client/localOnlyUsers.d.ts +25 -0
- package/dist/runtime/plugins/client/localOnlyUsers.js +110 -0
- package/dist/runtime/plugins/server/devMock.d.ts +51 -0
- package/dist/runtime/plugins/server/devMock.js +162 -0
- package/dist/runtime/server/utils/assertEventWithAuthorizedUser.d.ts +11 -0
- package/dist/runtime/server/utils/assertEventWithAuthorizedUser.js +10 -0
- package/dist/runtime/server/utils/createAuthMiddleware.d.ts +4 -4
- package/dist/runtime/server/utils/createAuthMiddleware.js +16 -23
- package/dist/runtime/server/utils/createAuthSchema.d.ts +391 -94
- package/dist/runtime/server/utils/createAuthSchema.js +43 -13
- package/dist/runtime/server/utils/createBetterAuth.d.ts +34 -0
- package/dist/runtime/server/utils/createBetterAuth.js +160 -0
- package/dist/runtime/server/utils/getBetterAuthInstance.d.ts +3 -0
- package/dist/runtime/server/utils/getBetterAuthInstance.js +10 -0
- package/dist/runtime/types.d.ts +358 -248
- package/dist/runtime/types.js +48 -25
- package/dist/runtime/utils/deserializeAuthLocalUser.d.ts +2 -0
- package/dist/runtime/utils/deserializeAuthLocalUser.js +9 -0
- package/package.json +44 -19
- package/dist/runtime/core/providers/github.d.ts +0 -84
- package/dist/runtime/core/providers/github.js +0 -55
- package/dist/runtime/core/providers/google.d.ts +0 -65
- package/dist/runtime/core/providers/google.js +0 -49
- package/dist/runtime/server/helpers/getSafeSecretsInfo.d.ts +0 -4
- package/dist/runtime/server/helpers/getSafeSecretsInfo.js +0 -10
- package/dist/runtime/server/helpers/logSafeRoute.d.ts +0 -1
- package/dist/runtime/server/helpers/logSafeRoute.js +0 -3
- package/dist/runtime/server/helpers/signJwt.d.ts +0 -3
- package/dist/runtime/server/helpers/signJwt.js +0 -16
- package/dist/runtime/server/helpers/verifyJwt.d.ts +0 -5
- package/dist/runtime/server/helpers/verifyJwt.js +0 -19
- package/dist/runtime/server/utils/Auth.d.ts +0 -85
- package/dist/runtime/server/utils/Auth.js +0 -671
- package/dist/runtime/server/utils/SessionManager.d.ts +0 -26
- package/dist/runtime/server/utils/SessionManager.js +0 -94
- package/dist/runtime/server/utils/createAuthHandler.d.ts +0 -9
- package/dist/runtime/server/utils/createAuthHandler.js +0 -29
- package/dist/runtime/utils/createExternalAuthLoginHandler.d.ts +0 -37
- package/dist/runtime/utils/createExternalAuthLoginHandler.js +0 -23
- package/dist/runtime/utils/getAuthApiRoute.d.ts +0 -6
- package/dist/runtime/utils/getAuthApiRoute.js +0 -14
|
@@ -3,50 +3,94 @@ type __VLS_Props = {
|
|
|
3
3
|
/** The link to the user's profile. Links to `/users/:username` (note this is not provided by the module). */
|
|
4
4
|
usernameLink?: (user: AuthUser) => string;
|
|
5
5
|
};
|
|
6
|
-
declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
declare const __VLS_template: () => {
|
|
7
|
+
__VLS_Slots: {
|
|
8
|
+
'authenticated-registered'?: (props: {
|
|
9
|
+
user: {
|
|
10
|
+
id: string;
|
|
11
|
+
email: string;
|
|
12
|
+
emailVerified: boolean;
|
|
13
|
+
name: string;
|
|
14
|
+
image: string | null;
|
|
15
|
+
isRegistered: boolean;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
type: "local";
|
|
19
|
+
username: string;
|
|
20
|
+
} | {
|
|
21
|
+
id: string;
|
|
22
|
+
email: string;
|
|
23
|
+
emailVerified: boolean;
|
|
24
|
+
name: string;
|
|
25
|
+
image: string | null;
|
|
26
|
+
isRegistered: boolean;
|
|
27
|
+
createdAt: Date;
|
|
28
|
+
updatedAt: Date;
|
|
29
|
+
username: string | null;
|
|
30
|
+
type?: "external" | undefined;
|
|
31
|
+
};
|
|
32
|
+
authRoutes: any;
|
|
33
|
+
}) => any;
|
|
34
|
+
} & {
|
|
35
|
+
user?: (props: {
|
|
36
|
+
user: {
|
|
37
|
+
id: string;
|
|
38
|
+
email: string;
|
|
39
|
+
emailVerified: boolean;
|
|
40
|
+
name: string;
|
|
41
|
+
image: string | null;
|
|
42
|
+
isRegistered: boolean;
|
|
43
|
+
createdAt: Date;
|
|
44
|
+
updatedAt: Date;
|
|
45
|
+
type: "local";
|
|
46
|
+
username: string;
|
|
47
|
+
} | {
|
|
48
|
+
id: string;
|
|
49
|
+
email: string;
|
|
50
|
+
emailVerified: boolean;
|
|
51
|
+
name: string;
|
|
52
|
+
image: string | null;
|
|
53
|
+
isRegistered: boolean;
|
|
54
|
+
createdAt: Date;
|
|
55
|
+
updatedAt: Date;
|
|
56
|
+
username: string | null;
|
|
57
|
+
type?: "external" | undefined;
|
|
58
|
+
};
|
|
59
|
+
}) => any;
|
|
60
|
+
} & {
|
|
61
|
+
'authenticated-unregistered'?: (props: {
|
|
62
|
+
user: {
|
|
63
|
+
id: string;
|
|
64
|
+
email: string;
|
|
65
|
+
emailVerified: boolean;
|
|
66
|
+
name: string;
|
|
67
|
+
image: string | null;
|
|
68
|
+
isRegistered: boolean;
|
|
69
|
+
createdAt: Date;
|
|
70
|
+
updatedAt: Date;
|
|
71
|
+
type: "local";
|
|
72
|
+
username: string;
|
|
73
|
+
} | {
|
|
74
|
+
id: string;
|
|
75
|
+
email: string;
|
|
76
|
+
emailVerified: boolean;
|
|
77
|
+
name: string;
|
|
78
|
+
image: string | null;
|
|
79
|
+
isRegistered: boolean;
|
|
80
|
+
createdAt: Date;
|
|
81
|
+
updatedAt: Date;
|
|
82
|
+
username: string | null;
|
|
83
|
+
type?: "external" | undefined;
|
|
84
|
+
};
|
|
85
|
+
authRoutes: any;
|
|
86
|
+
}) => any;
|
|
87
|
+
} & {
|
|
88
|
+
unauthenticated?: (props: {
|
|
89
|
+
authRoutes: any;
|
|
90
|
+
}) => any;
|
|
16
91
|
};
|
|
17
|
-
}, __VLS_3: {
|
|
18
|
-
user: AuthUser;
|
|
19
|
-
}, __VLS_19: {
|
|
20
|
-
user: AuthUser;
|
|
21
|
-
authRoutes: {
|
|
22
|
-
login: string | undefined;
|
|
23
|
-
unauthenticated?: string | undefined;
|
|
24
|
-
register?: string | undefined;
|
|
25
|
-
postRegisteredLogin?: string | undefined;
|
|
26
|
-
externalCode?: string | undefined;
|
|
27
|
-
deeplink?: string | undefined;
|
|
28
|
-
mockAuth?: string | undefined;
|
|
29
|
-
};
|
|
30
|
-
}, __VLS_35: {
|
|
31
|
-
authRoutes: {
|
|
32
|
-
login: string | undefined;
|
|
33
|
-
unauthenticated?: string | undefined;
|
|
34
|
-
register?: string | undefined;
|
|
35
|
-
postRegisteredLogin?: string | undefined;
|
|
36
|
-
externalCode?: string | undefined;
|
|
37
|
-
deeplink?: string | undefined;
|
|
38
|
-
mockAuth?: string | undefined;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
type __VLS_Slots = {} & {
|
|
42
|
-
'authenticated-registered'?: (props: typeof __VLS_1) => any;
|
|
43
|
-
} & {
|
|
44
|
-
user?: (props: typeof __VLS_3) => any;
|
|
45
|
-
} & {
|
|
46
|
-
'authenticated-unregistered'?: (props: typeof __VLS_19) => any;
|
|
47
|
-
} & {
|
|
48
|
-
unauthenticated?: (props: typeof __VLS_35) => any;
|
|
49
92
|
};
|
|
93
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
50
94
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
51
95
|
usernameLink: (user: AuthUser) => string;
|
|
52
96
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -12,16 +12,21 @@
|
|
|
12
12
|
:user="user"
|
|
13
13
|
>
|
|
14
14
|
<NuxtLink
|
|
15
|
+
v-if="profileLink"
|
|
15
16
|
:class="`
|
|
16
17
|
text-underline
|
|
17
18
|
text-l
|
|
18
|
-
${
|
|
19
|
+
${isExternalExpiredUser ? 'text-red-500' : ''}
|
|
19
20
|
`"
|
|
20
|
-
:title="
|
|
21
|
-
:to="
|
|
21
|
+
:title="isExternalExpiredUser ? 'You need to re-authenticate to use some parts of the app.' : ''"
|
|
22
|
+
:to="profileLink"
|
|
23
|
+
@click="openInBrowser($event)"
|
|
22
24
|
>
|
|
23
25
|
{{ "username" in user ? user.username : user }}
|
|
24
26
|
</NuxtLink>
|
|
27
|
+
<span v-else>
|
|
28
|
+
{{ "username" in user ? user.username : user }}
|
|
29
|
+
</span>
|
|
25
30
|
</slot>
|
|
26
31
|
<WButton
|
|
27
32
|
:unstyle="true"
|
|
@@ -68,18 +73,34 @@
|
|
|
68
73
|
</template>
|
|
69
74
|
|
|
70
75
|
<script setup>
|
|
76
|
+
import { computed, useRuntimeConfig, useState } from "#imports";
|
|
71
77
|
import { useAuth } from "../composables/useAuth";
|
|
78
|
+
import { isExpiredStateKey } from "../types.js";
|
|
72
79
|
const {
|
|
73
80
|
logout,
|
|
74
81
|
user,
|
|
75
82
|
authRoutes,
|
|
76
83
|
isAuthenticated,
|
|
77
|
-
|
|
84
|
+
isExternal
|
|
78
85
|
} = useAuth();
|
|
79
|
-
|
|
80
|
-
return isSemiAuthed.value ? useAuth().authRoutes.login : `/users/${"username" in user2 ? user2.username : ""}`;
|
|
81
|
-
}
|
|
82
|
-
defineProps({
|
|
86
|
+
const props = defineProps({
|
|
83
87
|
usernameLink: { type: Function, required: false, default: void 0 }
|
|
84
88
|
});
|
|
89
|
+
const publicServerUrl = useRuntimeConfig().public.auth.publicServerUrl;
|
|
90
|
+
const isExpired = useState(isExpiredStateKey, () => false);
|
|
91
|
+
const isExternalExpiredUser = computed(() => user.value?.type === "external" && isExpired.value);
|
|
92
|
+
const profileLink = computed(() => {
|
|
93
|
+
if (!user.value) return void 0;
|
|
94
|
+
const username = "username" in user.value ? user.value.username ?? "" : "";
|
|
95
|
+
const appPath = `/users/${username}`;
|
|
96
|
+
if (user.value.type === "local") return appPath;
|
|
97
|
+
return props.usernameLink ? props.usernameLink(user.value) : publicServerUrl && user.value.type !== void 0 ? `${publicServerUrl}/users/${username}` : appPath;
|
|
98
|
+
});
|
|
99
|
+
function openInBrowser(event) {
|
|
100
|
+
if (!isExternal.value || user.value?.type === "local") return;
|
|
101
|
+
const open = globalThis.electron?.api?.open;
|
|
102
|
+
if (typeof open !== "function" || !profileLink.value) return;
|
|
103
|
+
event.preventDefault();
|
|
104
|
+
open(profileLink.value);
|
|
105
|
+
}
|
|
85
106
|
</script>
|
|
@@ -3,50 +3,94 @@ type __VLS_Props = {
|
|
|
3
3
|
/** The link to the user's profile. Links to `/users/:username` (note this is not provided by the module). */
|
|
4
4
|
usernameLink?: (user: AuthUser) => string;
|
|
5
5
|
};
|
|
6
|
-
declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
declare const __VLS_template: () => {
|
|
7
|
+
__VLS_Slots: {
|
|
8
|
+
'authenticated-registered'?: (props: {
|
|
9
|
+
user: {
|
|
10
|
+
id: string;
|
|
11
|
+
email: string;
|
|
12
|
+
emailVerified: boolean;
|
|
13
|
+
name: string;
|
|
14
|
+
image: string | null;
|
|
15
|
+
isRegistered: boolean;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
type: "local";
|
|
19
|
+
username: string;
|
|
20
|
+
} | {
|
|
21
|
+
id: string;
|
|
22
|
+
email: string;
|
|
23
|
+
emailVerified: boolean;
|
|
24
|
+
name: string;
|
|
25
|
+
image: string | null;
|
|
26
|
+
isRegistered: boolean;
|
|
27
|
+
createdAt: Date;
|
|
28
|
+
updatedAt: Date;
|
|
29
|
+
username: string | null;
|
|
30
|
+
type?: "external" | undefined;
|
|
31
|
+
};
|
|
32
|
+
authRoutes: any;
|
|
33
|
+
}) => any;
|
|
34
|
+
} & {
|
|
35
|
+
user?: (props: {
|
|
36
|
+
user: {
|
|
37
|
+
id: string;
|
|
38
|
+
email: string;
|
|
39
|
+
emailVerified: boolean;
|
|
40
|
+
name: string;
|
|
41
|
+
image: string | null;
|
|
42
|
+
isRegistered: boolean;
|
|
43
|
+
createdAt: Date;
|
|
44
|
+
updatedAt: Date;
|
|
45
|
+
type: "local";
|
|
46
|
+
username: string;
|
|
47
|
+
} | {
|
|
48
|
+
id: string;
|
|
49
|
+
email: string;
|
|
50
|
+
emailVerified: boolean;
|
|
51
|
+
name: string;
|
|
52
|
+
image: string | null;
|
|
53
|
+
isRegistered: boolean;
|
|
54
|
+
createdAt: Date;
|
|
55
|
+
updatedAt: Date;
|
|
56
|
+
username: string | null;
|
|
57
|
+
type?: "external" | undefined;
|
|
58
|
+
};
|
|
59
|
+
}) => any;
|
|
60
|
+
} & {
|
|
61
|
+
'authenticated-unregistered'?: (props: {
|
|
62
|
+
user: {
|
|
63
|
+
id: string;
|
|
64
|
+
email: string;
|
|
65
|
+
emailVerified: boolean;
|
|
66
|
+
name: string;
|
|
67
|
+
image: string | null;
|
|
68
|
+
isRegistered: boolean;
|
|
69
|
+
createdAt: Date;
|
|
70
|
+
updatedAt: Date;
|
|
71
|
+
type: "local";
|
|
72
|
+
username: string;
|
|
73
|
+
} | {
|
|
74
|
+
id: string;
|
|
75
|
+
email: string;
|
|
76
|
+
emailVerified: boolean;
|
|
77
|
+
name: string;
|
|
78
|
+
image: string | null;
|
|
79
|
+
isRegistered: boolean;
|
|
80
|
+
createdAt: Date;
|
|
81
|
+
updatedAt: Date;
|
|
82
|
+
username: string | null;
|
|
83
|
+
type?: "external" | undefined;
|
|
84
|
+
};
|
|
85
|
+
authRoutes: any;
|
|
86
|
+
}) => any;
|
|
87
|
+
} & {
|
|
88
|
+
unauthenticated?: (props: {
|
|
89
|
+
authRoutes: any;
|
|
90
|
+
}) => any;
|
|
16
91
|
};
|
|
17
|
-
}, __VLS_3: {
|
|
18
|
-
user: AuthUser;
|
|
19
|
-
}, __VLS_19: {
|
|
20
|
-
user: AuthUser;
|
|
21
|
-
authRoutes: {
|
|
22
|
-
login: string | undefined;
|
|
23
|
-
unauthenticated?: string | undefined;
|
|
24
|
-
register?: string | undefined;
|
|
25
|
-
postRegisteredLogin?: string | undefined;
|
|
26
|
-
externalCode?: string | undefined;
|
|
27
|
-
deeplink?: string | undefined;
|
|
28
|
-
mockAuth?: string | undefined;
|
|
29
|
-
};
|
|
30
|
-
}, __VLS_35: {
|
|
31
|
-
authRoutes: {
|
|
32
|
-
login: string | undefined;
|
|
33
|
-
unauthenticated?: string | undefined;
|
|
34
|
-
register?: string | undefined;
|
|
35
|
-
postRegisteredLogin?: string | undefined;
|
|
36
|
-
externalCode?: string | undefined;
|
|
37
|
-
deeplink?: string | undefined;
|
|
38
|
-
mockAuth?: string | undefined;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
type __VLS_Slots = {} & {
|
|
42
|
-
'authenticated-registered'?: (props: typeof __VLS_1) => any;
|
|
43
|
-
} & {
|
|
44
|
-
user?: (props: typeof __VLS_3) => any;
|
|
45
|
-
} & {
|
|
46
|
-
'authenticated-unregistered'?: (props: typeof __VLS_19) => any;
|
|
47
|
-
} & {
|
|
48
|
-
unauthenticated?: (props: typeof __VLS_35) => any;
|
|
49
92
|
};
|
|
93
|
+
type __VLS_Slots = ReturnType<typeof __VLS_template>['__VLS_Slots'];
|
|
50
94
|
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
51
95
|
usernameLink: (user: AuthUser) => string;
|
|
52
96
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
|
2
|
+
import type { useAuth } from "../composables/useAuth.js";
|
|
2
3
|
/**
|
|
3
4
|
* @deprecated This component is deprecated and will be removed in a future version.
|
|
4
5
|
*/
|
|
5
6
|
declare const _default: typeof __VLS_export;
|
|
6
7
|
export default _default;
|
|
7
8
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
9
|
+
/** The auth instance to register against, so the app can pass one carrying its platform plugins. */
|
|
10
|
+
auth?: ReturnType<typeof useAuth>;
|
|
8
11
|
debounce?: number;
|
|
9
12
|
usernameSchema?: StandardSchemaV1<string, string>;
|
|
10
13
|
id?: string;
|
|
11
14
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
15
|
+
/** The auth instance to register against, so the app can pass one carrying its platform plugins. */
|
|
16
|
+
auth?: ReturnType<typeof useAuth>;
|
|
12
17
|
debounce?: number;
|
|
13
18
|
usernameSchema?: StandardSchemaV1<string, string>;
|
|
14
19
|
id?: string;
|
|
@@ -53,6 +53,7 @@ if (import.meta.dev) {
|
|
|
53
53
|
console.warn("[nuxt-auth] <UserRegistration> is deprecated and will be removed in a future version.");
|
|
54
54
|
}
|
|
55
55
|
const props = defineProps({
|
|
56
|
+
auth: { type: null, required: false },
|
|
56
57
|
debounce: { type: Number, required: false },
|
|
57
58
|
usernameSchema: { type: Object, required: false },
|
|
58
59
|
id: { type: String, required: false }
|
|
@@ -69,6 +70,7 @@ const {
|
|
|
69
70
|
inputValid,
|
|
70
71
|
isDebouncing
|
|
71
72
|
} = useAuthUserRegistration({
|
|
73
|
+
auth: props.auth,
|
|
72
74
|
debounce: props.debounce,
|
|
73
75
|
usernameSchema: props.usernameSchema,
|
|
74
76
|
statusTextMap: {
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
|
2
|
+
import type { useAuth } from "../composables/useAuth.js";
|
|
2
3
|
/**
|
|
3
4
|
* @deprecated This component is deprecated and will be removed in a future version.
|
|
4
5
|
*/
|
|
5
6
|
declare const _default: typeof __VLS_export;
|
|
6
7
|
export default _default;
|
|
7
8
|
declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
9
|
+
/** The auth instance to register against, so the app can pass one carrying its platform plugins. */
|
|
10
|
+
auth?: ReturnType<typeof useAuth>;
|
|
8
11
|
debounce?: number;
|
|
9
12
|
usernameSchema?: StandardSchemaV1<string, string>;
|
|
10
13
|
id?: string;
|
|
11
14
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
15
|
+
/** The auth instance to register against, so the app can pass one carrying its platform plugins. */
|
|
16
|
+
auth?: ReturnType<typeof useAuth>;
|
|
12
17
|
debounce?: number;
|
|
13
18
|
usernameSchema?: StandardSchemaV1<string, string>;
|
|
14
19
|
id?: string;
|