@better-auth-ui/react 1.6.1 → 1.6.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/components/auth/auth-provider.d.ts +4 -3
- package/dist/components/auth/auth-provider.js +24 -40
- package/dist/components/email/email-changed.d.ts +2 -2
- package/dist/components/email/email-changed.js +154 -68
- package/dist/components/email/email-localization.js +18 -23
- package/dist/components/email/email-styles.js +52 -77
- package/dist/components/email/email-verification.d.ts +2 -2
- package/dist/components/email/email-verification.js +138 -73
- package/dist/components/email/index.d.ts +9 -9
- package/dist/components/email/index.js +9 -9
- package/dist/components/email/magic-link.d.ts +2 -2
- package/dist/components/email/magic-link.js +139 -70
- package/dist/components/email/new-device.d.ts +2 -2
- package/dist/components/email/new-device.js +221 -88
- package/dist/components/email/otp-email.d.ts +2 -2
- package/dist/components/email/otp-email.js +127 -63
- package/dist/components/email/password-changed.d.ts +2 -2
- package/dist/components/email/password-changed.js +157 -74
- package/dist/components/email/reset-password.d.ts +2 -2
- package/dist/components/email/reset-password.js +138 -66
- package/dist/components/icons/apple.d.ts +1 -1
- package/dist/components/icons/apple.js +16 -9
- package/dist/components/icons/atlassian.d.ts +1 -1
- package/dist/components/icons/atlassian.js +38 -13
- package/dist/components/icons/cognito.d.ts +1 -1
- package/dist/components/icons/cognito.js +19 -9
- package/dist/components/icons/discord.d.ts +1 -1
- package/dist/components/icons/discord.js +16 -9
- package/dist/components/icons/dropbox.d.ts +1 -1
- package/dist/components/icons/dropbox.js +16 -9
- package/dist/components/icons/facebook.d.ts +1 -1
- package/dist/components/icons/facebook.js +19 -11
- package/dist/components/icons/figma.d.ts +1 -1
- package/dist/components/icons/figma.js +34 -12
- package/dist/components/icons/github.d.ts +1 -1
- package/dist/components/icons/github.js +16 -11
- package/dist/components/icons/gitlab.d.ts +1 -1
- package/dist/components/icons/gitlab.js +30 -9
- package/dist/components/icons/google.d.ts +1 -1
- package/dist/components/icons/google.js +39 -9
- package/dist/components/icons/huggingface.d.ts +1 -1
- package/dist/components/icons/huggingface.js +38 -9
- package/dist/components/icons/index.d.ts +35 -35
- package/dist/components/icons/index.js +35 -35
- package/dist/components/icons/kakao.d.ts +1 -1
- package/dist/components/icons/kakao.js +16 -11
- package/dist/components/icons/kick.d.ts +1 -1
- package/dist/components/icons/kick.js +20 -11
- package/dist/components/icons/line.d.ts +1 -1
- package/dist/components/icons/line.js +16 -9
- package/dist/components/icons/linear.d.ts +1 -1
- package/dist/components/icons/linear.js +16 -9
- package/dist/components/icons/linkedin.d.ts +1 -1
- package/dist/components/icons/linkedin.js +33 -9
- package/dist/components/icons/microsoft.d.ts +1 -1
- package/dist/components/icons/microsoft.js +30 -9
- package/dist/components/icons/naver.d.ts +1 -1
- package/dist/components/icons/naver.js +16 -9
- package/dist/components/icons/notion.d.ts +1 -1
- package/dist/components/icons/notion.js +16 -9
- package/dist/components/icons/paybin.d.ts +1 -1
- package/dist/components/icons/paybin.js +32 -8
- package/dist/components/icons/paypal.d.ts +1 -1
- package/dist/components/icons/paypal.js +30 -9
- package/dist/components/icons/polar.d.ts +1 -1
- package/dist/components/icons/polar.js +24 -9
- package/dist/components/icons/railway.d.ts +1 -1
- package/dist/components/icons/railway.js +16 -9
- package/dist/components/icons/reddit.d.ts +1 -1
- package/dist/components/icons/reddit.js +21 -9
- package/dist/components/icons/roblox.d.ts +1 -1
- package/dist/components/icons/roblox.js +17 -12
- package/dist/components/icons/salesforce.d.ts +1 -1
- package/dist/components/icons/salesforce.js +16 -9
- package/dist/components/icons/slack.d.ts +1 -1
- package/dist/components/icons/slack.js +30 -9
- package/dist/components/icons/spotify.d.ts +1 -1
- package/dist/components/icons/spotify.js +16 -9
- package/dist/components/icons/tiktok.d.ts +1 -1
- package/dist/components/icons/tiktok.js +23 -10
- package/dist/components/icons/twitch.d.ts +1 -1
- package/dist/components/icons/twitch.js +43 -12
- package/dist/components/icons/vercel.d.ts +1 -1
- package/dist/components/icons/vercel.js +16 -9
- package/dist/components/icons/vk.d.ts +1 -1
- package/dist/components/icons/vk.js +16 -9
- package/dist/components/icons/wechat.d.ts +1 -1
- package/dist/components/icons/wechat.js +16 -9
- package/dist/components/icons/x.d.ts +1 -1
- package/dist/components/icons/x.js +16 -9
- package/dist/components/icons/zoom.d.ts +1 -1
- package/dist/components/icons/zoom.js +69 -11
- package/dist/components/settings/account/theme-preview.js +286 -7
- package/dist/core.d.ts +1 -1
- package/dist/hooks/auth/use-auth-mutation.d.ts +2 -2
- package/dist/hooks/auth/use-auth-mutation.js +12 -9
- package/dist/hooks/auth/use-auth-query.d.ts +3 -3
- package/dist/hooks/auth/use-auth-query.js +12 -9
- package/dist/hooks/auth/use-authenticate.d.ts +2 -2
- package/dist/hooks/auth/use-authenticate.js +22 -27
- package/dist/hooks/auth/use-is-username-available.d.ts +19 -0
- package/dist/hooks/auth/use-is-username-available.js +12 -0
- package/dist/hooks/auth/use-request-password-reset.d.ts +5 -6
- package/dist/hooks/auth/use-request-password-reset.js +11 -13
- package/dist/hooks/auth/use-reset-password.d.ts +8 -9
- package/dist/hooks/auth/use-reset-password.js +11 -12
- package/dist/hooks/auth/use-send-verification-email.d.ts +5 -6
- package/dist/hooks/auth/use-send-verification-email.js +11 -12
- package/dist/hooks/auth/use-session.d.ts +2 -2
- package/dist/hooks/auth/use-session.js +14 -17
- package/dist/hooks/auth/use-sign-in-email.d.ts +6 -7
- package/dist/hooks/auth/use-sign-in-email.js +17 -24
- package/dist/hooks/auth/use-sign-in-magic-link.d.ts +5 -6
- package/dist/hooks/auth/use-sign-in-magic-link.js +11 -12
- package/dist/hooks/auth/use-sign-in-passkey.d.ts +14 -14
- package/dist/hooks/auth/use-sign-in-passkey.js +17 -24
- package/dist/hooks/auth/use-sign-in-social.d.ts +8 -9
- package/dist/hooks/auth/use-sign-in-social.js +11 -12
- package/dist/hooks/auth/use-sign-in-username.d.ts +53 -0
- package/dist/hooks/auth/use-sign-in-username.js +18 -0
- package/dist/hooks/auth/use-sign-out.d.ts +4 -5
- package/dist/hooks/auth/use-sign-out.js +17 -23
- package/dist/hooks/auth/use-sign-up-email.d.ts +166 -167
- package/dist/hooks/auth/use-sign-up-email.js +17 -24
- package/dist/hooks/auth/use-user.d.ts +58 -58
- package/dist/hooks/auth/use-user.js +10 -13
- package/dist/hooks/settings/use-account-info.d.ts +5 -5
- package/dist/hooks/settings/use-account-info.js +20 -24
- package/dist/hooks/settings/use-add-passkey.d.ts +10 -10
- package/dist/hooks/settings/use-add-passkey.js +17 -23
- package/dist/hooks/settings/use-change-email.d.ts +5 -5
- package/dist/hooks/settings/use-change-email.js +17 -22
- package/dist/hooks/settings/use-change-password.d.ts +6 -7
- package/dist/hooks/settings/use-change-password.js +11 -10
- package/dist/hooks/settings/use-delete-passkey.d.ts +5 -5
- package/dist/hooks/settings/use-delete-passkey.js +17 -23
- package/dist/hooks/settings/use-delete-user.d.ts +8 -9
- package/dist/hooks/settings/use-delete-user.js +11 -10
- package/dist/hooks/settings/use-link-social.d.ts +5 -5
- package/dist/hooks/settings/use-link-social.js +11 -9
- package/dist/hooks/settings/use-list-accounts.d.ts +4 -4
- package/dist/hooks/settings/use-list-accounts.js +20 -22
- package/dist/hooks/settings/use-list-device-sessions.d.ts +2 -2
- package/dist/hooks/settings/use-list-device-sessions.js +20 -21
- package/dist/hooks/settings/use-list-sessions.d.ts +4 -4
- package/dist/hooks/settings/use-list-sessions.js +20 -21
- package/dist/hooks/settings/use-list-user-passkeys.d.ts +3 -3
- package/dist/hooks/settings/use-list-user-passkeys.js +20 -21
- package/dist/hooks/settings/use-revoke-multi-session.d.ts +5 -5
- package/dist/hooks/settings/use-revoke-multi-session.js +17 -19
- package/dist/hooks/settings/use-revoke-session.d.ts +5 -5
- package/dist/hooks/settings/use-revoke-session.js +17 -20
- package/dist/hooks/settings/use-set-active-session.d.ts +5 -5
- package/dist/hooks/settings/use-set-active-session.js +20 -27
- package/dist/hooks/settings/use-unlink-account.d.ts +5 -5
- package/dist/hooks/settings/use-unlink-account.js +17 -20
- package/dist/hooks/settings/use-update-user.d.ts +2 -2
- package/dist/hooks/settings/use-update-user.js +24 -28
- package/dist/index.d.ts +40 -36
- package/dist/index.js +84 -36
- package/dist/lib/auth-client.d.ts +1254 -1254
- package/dist/lib/auth-client.js +11 -11
- package/dist/lib/auth-config.d.ts +3 -3
- package/dist/lib/auth-context.d.ts +2 -2
- package/dist/lib/auth-context.js +5 -2
- package/dist/lib/provider-icons.d.ts +2 -2
- package/dist/lib/provider-icons.js +75 -47
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +7 -4
- package/package.json +11 -11
- package/src/components/auth/auth-provider.tsx +4 -6
- package/src/hooks/auth/use-authenticate.ts +3 -1
- package/src/hooks/auth/use-is-username-available.ts +22 -0
- package/src/hooks/auth/use-request-password-reset.ts +4 -6
- package/src/hooks/auth/use-reset-password.ts +4 -6
- package/src/hooks/auth/use-send-verification-email.ts +4 -6
- package/src/hooks/auth/use-session.ts +2 -1
- package/src/hooks/auth/use-sign-in-email.ts +6 -8
- package/src/hooks/auth/use-sign-in-magic-link.ts +4 -6
- package/src/hooks/auth/use-sign-in-social.ts +4 -6
- package/src/hooks/auth/use-sign-in-username.ts +34 -0
- package/src/hooks/auth/use-sign-out.ts +6 -7
- package/src/hooks/auth/use-sign-up-email.ts +6 -8
- package/src/hooks/auth/use-user.ts +1 -2
- package/src/hooks/settings/use-account-info.ts +2 -1
- package/src/hooks/settings/use-change-email.ts +6 -6
- package/src/hooks/settings/use-change-password.ts +4 -6
- package/src/hooks/settings/use-delete-user.ts +4 -6
- package/src/hooks/settings/use-link-social.ts +4 -4
- package/src/hooks/settings/use-list-accounts.ts +3 -1
- package/src/hooks/settings/use-list-device-sessions.ts +3 -1
- package/src/hooks/settings/use-list-sessions.ts +3 -1
- package/src/hooks/settings/use-list-user-passkeys.ts +3 -1
- package/src/hooks/settings/use-revoke-multi-session.ts +6 -6
- package/src/hooks/settings/use-revoke-session.ts +4 -5
- package/src/hooks/settings/use-set-active-session.ts +9 -8
- package/src/hooks/settings/use-unlink-account.ts +4 -5
- package/src/hooks/settings/use-update-user.ts +8 -9
- package/src/index.ts +4 -0
- package/src/lib/auth-config.ts +1 -1
- package/dist/lib/auth-config.js +0 -1
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
...options,
|
|
17
|
-
onSuccess: async (...args) => {
|
|
18
|
-
refetch();
|
|
19
|
-
await options?.onSuccess?.(...args);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { useAuthMutation as t } from "../auth/use-auth-mutation.js";
|
|
3
|
+
import { useSession as n } from "../auth/use-session.js";
|
|
4
|
+
//#region src/hooks/settings/use-change-email.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { authClient: i } = e(), { refetch: a } = n({ refetchOnMount: !1 });
|
|
7
|
+
return t({
|
|
8
|
+
authFn: i.changeEmail,
|
|
9
|
+
options: {
|
|
10
|
+
...r,
|
|
11
|
+
onSuccess: async (...e) => {
|
|
12
|
+
a(), await r?.onSuccess?.(...e);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
23
16
|
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as useChangeEmail };
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export { useAuthMutation } from "../auth/use-auth-mutation";
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthMutationOptions } from '../auth/use-auth-mutation';
|
|
4
3
|
/**
|
|
5
4
|
* Hook that creates a mutation for changing the authenticated user's password.
|
|
6
5
|
*
|
|
7
6
|
* @returns The `useMutation` result.
|
|
8
7
|
*/
|
|
9
|
-
export declare function useChangePassword(options?: UseAuthMutationOptions<AuthClient["changePassword"]>): import(
|
|
8
|
+
export declare function useChangePassword(options?: UseAuthMutationOptions<AuthClient["changePassword"]>): import('../..').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
|
|
10
9
|
newPassword: string;
|
|
11
10
|
currentPassword: string;
|
|
12
11
|
revokeOtherSessions?: boolean | undefined;
|
|
13
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import(
|
|
12
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
|
|
14
13
|
newPassword: string;
|
|
15
14
|
currentPassword: string;
|
|
16
15
|
revokeOtherSessions?: boolean | undefined;
|
|
17
16
|
} & {
|
|
18
17
|
fetchOptions?: FetchOptions | undefined;
|
|
19
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import(
|
|
18
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<Omit<{
|
|
20
19
|
token: string | null;
|
|
21
20
|
user: {
|
|
22
21
|
id: string;
|
|
@@ -36,7 +35,7 @@ export declare function useChangePassword(options?: UseAuthMutationOptions<AuthC
|
|
|
36
35
|
image?: string | null | undefined;
|
|
37
36
|
};
|
|
38
37
|
}, "user"> & {
|
|
39
|
-
user: import(
|
|
38
|
+
user: import('better-auth').StripEmptyObjects<{
|
|
40
39
|
id: string;
|
|
41
40
|
createdAt: Date;
|
|
42
41
|
updatedAt: Date;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return useAuthMutation({ authFn: authClient.changePassword, options });
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { useAuthMutation as t } from "../auth/use-auth-mutation.js";
|
|
3
|
+
//#region src/hooks/settings/use-change-password.ts
|
|
4
|
+
function n(n) {
|
|
5
|
+
let { authClient: r } = e();
|
|
6
|
+
return t({
|
|
7
|
+
authFn: r.changePassword,
|
|
8
|
+
options: n
|
|
9
|
+
});
|
|
11
10
|
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as useChangePassword };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthMutationOptions } from '../auth/use-auth-mutation';
|
|
3
3
|
/**
|
|
4
4
|
* Hook that creates a mutation for deleting a passkey.
|
|
5
5
|
*
|
|
@@ -7,13 +7,13 @@ import { type UseAuthMutationOptions } from "../auth/use-auth-mutation";
|
|
|
7
7
|
*
|
|
8
8
|
* @returns The `useMutation` result.
|
|
9
9
|
*/
|
|
10
|
-
export declare function useDeletePasskey(options?: UseAuthMutationOptions<AuthClient["passkey"]["deletePasskey"]>): import(
|
|
10
|
+
export declare function useDeletePasskey(options?: UseAuthMutationOptions<AuthClient["passkey"]["deletePasskey"]>): import('../..').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
|
|
11
11
|
id: string;
|
|
12
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import(
|
|
12
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
|
|
13
13
|
id: string;
|
|
14
14
|
} & {
|
|
15
15
|
fetchOptions?: FetchOptions | undefined;
|
|
16
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import(
|
|
16
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
|
|
17
17
|
status: boolean;
|
|
18
18
|
}, {
|
|
19
19
|
code?: string | undefined;
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
import { useAuth } from "../../components/auth/auth-provider";
|
|
2
|
-
import { useAuthMutation } from "../auth/use-auth-mutation";
|
|
3
|
-
import { useListUserPasskeys } from "./use-list-user-passkeys";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
options: {
|
|
17
|
-
...options,
|
|
18
|
-
onSuccess: async (...args) => {
|
|
19
|
-
await refetch();
|
|
20
|
-
await options?.onSuccess?.(...args);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
});
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { useAuthMutation as t } from "../auth/use-auth-mutation.js";
|
|
3
|
+
import { useListUserPasskeys as n } from "./use-list-user-passkeys.js";
|
|
4
|
+
//#region src/hooks/settings/use-delete-passkey.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { authClient: i } = e(), { refetch: a } = n();
|
|
7
|
+
return t({
|
|
8
|
+
authFn: i.passkey.deletePasskey,
|
|
9
|
+
options: {
|
|
10
|
+
...r,
|
|
11
|
+
onSuccess: async (...e) => {
|
|
12
|
+
await a(), await r?.onSuccess?.(...e);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
24
16
|
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as useDeletePasskey };
|
|
@@ -1,38 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export { useAuthMutation } from "../auth/use-auth-mutation";
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthMutationOptions } from '../auth/use-auth-mutation';
|
|
4
3
|
/**
|
|
5
4
|
* Hook that creates a mutation for deleting the authenticated user account.
|
|
6
5
|
*
|
|
7
6
|
* @returns The `useMutation` result.
|
|
8
7
|
*/
|
|
9
|
-
export declare function useDeleteUser(options?: UseAuthMutationOptions<AuthClient["deleteUser"]>): import(
|
|
8
|
+
export declare function useDeleteUser(options?: UseAuthMutationOptions<AuthClient["deleteUser"]>): import('../..').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
|
|
10
9
|
callbackURL?: string | undefined;
|
|
11
10
|
password?: string | undefined;
|
|
12
11
|
token?: string | undefined;
|
|
13
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import(
|
|
12
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<{
|
|
14
13
|
callbackURL?: string | undefined;
|
|
15
14
|
password?: string | undefined;
|
|
16
15
|
token?: string | undefined;
|
|
17
16
|
} & {
|
|
18
17
|
fetchOptions?: FetchOptions | undefined;
|
|
19
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import(
|
|
18
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
|
|
20
19
|
success: boolean;
|
|
21
20
|
message: string;
|
|
22
21
|
}, {
|
|
23
22
|
code?: string | undefined;
|
|
24
23
|
message?: string | undefined;
|
|
25
24
|
}, FetchOptions["throw"] extends true ? true : false>>) & {
|
|
26
|
-
callback: <FetchOptions extends import(
|
|
25
|
+
callback: <FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<{
|
|
27
26
|
token: string;
|
|
28
27
|
callbackURL?: string | undefined;
|
|
29
|
-
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: import(
|
|
28
|
+
}> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
|
|
30
29
|
query: {
|
|
31
30
|
token: string;
|
|
32
31
|
callbackURL?: string | undefined;
|
|
33
32
|
};
|
|
34
33
|
fetchOptions?: FetchOptions | undefined;
|
|
35
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import(
|
|
34
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
|
|
36
35
|
success: boolean;
|
|
37
36
|
message: string;
|
|
38
37
|
}, {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return useAuthMutation({ authFn: authClient.deleteUser, options });
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { useAuthMutation as t } from "../auth/use-auth-mutation.js";
|
|
3
|
+
//#region src/hooks/settings/use-delete-user.ts
|
|
4
|
+
function n(n) {
|
|
5
|
+
let { authClient: r } = e();
|
|
6
|
+
return t({
|
|
7
|
+
authFn: r.deleteUser,
|
|
8
|
+
options: n
|
|
9
|
+
});
|
|
11
10
|
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as useDeleteUser };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthMutationOptions } from '../auth/use-auth-mutation';
|
|
3
3
|
/**
|
|
4
4
|
* Hook that creates a mutation for linking a social provider to the current user.
|
|
5
5
|
*
|
|
6
6
|
* @returns The `useMutation` result.
|
|
7
7
|
*/
|
|
8
|
-
export declare function useLinkSocial(options?: UseAuthMutationOptions<AuthClient["linkSocial"]>): import(
|
|
8
|
+
export declare function useLinkSocial(options?: UseAuthMutationOptions<AuthClient["linkSocial"]>): import('../..').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
|
|
9
9
|
provider: unknown;
|
|
10
10
|
callbackURL?: string | undefined;
|
|
11
11
|
idToken?: {
|
|
@@ -20,7 +20,7 @@ export declare function useLinkSocial(options?: UseAuthMutationOptions<AuthClien
|
|
|
20
20
|
errorCallbackURL?: string | undefined;
|
|
21
21
|
disableRedirect?: boolean | undefined;
|
|
22
22
|
additionalData?: Record<string, any> | undefined;
|
|
23
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import(
|
|
23
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
|
|
24
24
|
provider: unknown;
|
|
25
25
|
callbackURL?: string | undefined;
|
|
26
26
|
idToken?: {
|
|
@@ -37,7 +37,7 @@ export declare function useLinkSocial(options?: UseAuthMutationOptions<AuthClien
|
|
|
37
37
|
additionalData?: Record<string, any> | undefined;
|
|
38
38
|
} & {
|
|
39
39
|
fetchOptions?: FetchOptions | undefined;
|
|
40
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import(
|
|
40
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
|
|
41
41
|
url: string;
|
|
42
42
|
redirect: boolean;
|
|
43
43
|
}, {
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { useAuthMutation as t } from "../auth/use-auth-mutation.js";
|
|
3
|
+
//#region src/hooks/settings/use-link-social.ts
|
|
4
|
+
function n(n) {
|
|
5
|
+
let { authClient: r } = e();
|
|
6
|
+
return t({
|
|
7
|
+
authFn: r.linkSocial,
|
|
8
|
+
options: n
|
|
9
|
+
});
|
|
10
10
|
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as useLinkSocial };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthQueryOptions } from '../auth/use-auth-query';
|
|
3
3
|
/**
|
|
4
4
|
* Retrieve the current user's linked social accounts.
|
|
5
5
|
*
|
|
@@ -9,7 +9,7 @@ import { type UseAuthQueryOptions } from "../auth/use-auth-query";
|
|
|
9
9
|
* @param options - Optional react-query / initial-data options forwarded to `useSession` and `useQuery`
|
|
10
10
|
* @returns The react-query result containing linked accounts data, loading state, and error state
|
|
11
11
|
*/
|
|
12
|
-
export declare function useListAccounts(options?: Partial<UseAuthQueryOptions<AuthClient["listAccounts"]>>): import(
|
|
12
|
+
export declare function useListAccounts(options?: Partial<UseAuthQueryOptions<AuthClient["listAccounts"]>>): import('@tanstack/react-query').UseQueryResult<{
|
|
13
13
|
scopes: string[];
|
|
14
14
|
id: string;
|
|
15
15
|
createdAt: Date;
|
|
@@ -17,4 +17,4 @@ export declare function useListAccounts(options?: Partial<UseAuthQueryOptions<Au
|
|
|
17
17
|
userId: string;
|
|
18
18
|
providerId: string;
|
|
19
19
|
accountId: string;
|
|
20
|
-
}[] | null, import(
|
|
20
|
+
}[] | null, import('better-auth/client').BetterFetchError>;
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
import { useAuthQuery } from "../auth/use-auth-query";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
enabled: !!session,
|
|
20
|
-
...options
|
|
21
|
-
}
|
|
22
|
-
});
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { useAuthQuery as t } from "../auth/use-auth-query.js";
|
|
3
|
+
import { useSession as n } from "../auth/use-session.js";
|
|
4
|
+
//#region src/hooks/settings/use-list-accounts.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { authClient: i } = e(), { data: a } = n({ refetchOnMount: !1 });
|
|
7
|
+
return t({
|
|
8
|
+
authFn: i.listAccounts,
|
|
9
|
+
options: {
|
|
10
|
+
queryKey: [
|
|
11
|
+
"auth",
|
|
12
|
+
"listAccounts",
|
|
13
|
+
a?.user.id
|
|
14
|
+
],
|
|
15
|
+
enabled: !!a,
|
|
16
|
+
...r
|
|
17
|
+
}
|
|
18
|
+
});
|
|
23
19
|
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { r as useListAccounts };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthQueryOptions, UseAuthQueryResult } from '../auth/use-auth-query';
|
|
3
3
|
/**
|
|
4
4
|
* Retrieve device sessions for multi-session account switching.
|
|
5
5
|
*
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
import { useAuthQuery } from "../auth/use-auth-query";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
...options
|
|
20
|
-
}
|
|
21
|
-
});
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { useAuthQuery as t } from "../auth/use-auth-query.js";
|
|
3
|
+
import { useSession as n } from "../auth/use-session.js";
|
|
4
|
+
//#region src/hooks/settings/use-list-device-sessions.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { authClient: i } = e(), { data: a } = n({ refetchOnMount: !1 });
|
|
7
|
+
return t({
|
|
8
|
+
authFn: i.multiSession.listDeviceSessions,
|
|
9
|
+
options: {
|
|
10
|
+
queryKey: [
|
|
11
|
+
"auth",
|
|
12
|
+
"multiSession",
|
|
13
|
+
"listDeviceSessions"
|
|
14
|
+
],
|
|
15
|
+
enabled: !!a,
|
|
16
|
+
...r
|
|
17
|
+
}
|
|
18
|
+
});
|
|
22
19
|
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { r as useListDeviceSessions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthQueryOptions } from '../auth/use-auth-query';
|
|
3
3
|
/**
|
|
4
4
|
* Retrieve the active sessions (devices where the current user is signed in).
|
|
5
5
|
*
|
|
@@ -8,7 +8,7 @@ import { type UseAuthQueryOptions } from "../auth/use-auth-query";
|
|
|
8
8
|
* @param options - Optional React Query options to customize the query behavior.
|
|
9
9
|
* @returns The React Query result for the sessions list; `data` is the array of session objects, and the result includes loading and error states.
|
|
10
10
|
*/
|
|
11
|
-
export declare function useListSessions(options?: Partial<UseAuthQueryOptions<AuthClient["listSessions"]>>): import(
|
|
11
|
+
export declare function useListSessions(options?: Partial<UseAuthQueryOptions<AuthClient["listSessions"]>>): import('@tanstack/react-query').UseQueryResult<import('better-auth').Prettify<{
|
|
12
12
|
id: string;
|
|
13
13
|
createdAt: Date;
|
|
14
14
|
updatedAt: Date;
|
|
@@ -17,4 +17,4 @@ export declare function useListSessions(options?: Partial<UseAuthQueryOptions<Au
|
|
|
17
17
|
token: string;
|
|
18
18
|
ipAddress?: string | null | undefined | undefined;
|
|
19
19
|
userAgent?: string | null | undefined | undefined;
|
|
20
|
-
}>[] | null, import(
|
|
20
|
+
}>[] | null, import('better-auth/client').BetterFetchError>;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
import { useAuthQuery } from "../auth/use-auth-query";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
...options
|
|
20
|
-
}
|
|
21
|
-
});
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { useAuthQuery as t } from "../auth/use-auth-query.js";
|
|
3
|
+
import { useSession as n } from "../auth/use-session.js";
|
|
4
|
+
//#region src/hooks/settings/use-list-sessions.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { authClient: i } = e(), { data: a } = n({ refetchOnMount: !1 });
|
|
7
|
+
return t({
|
|
8
|
+
authFn: i.listSessions,
|
|
9
|
+
options: {
|
|
10
|
+
queryKey: [
|
|
11
|
+
"auth",
|
|
12
|
+
"listSessions",
|
|
13
|
+
a?.user.id
|
|
14
|
+
],
|
|
15
|
+
enabled: !!a,
|
|
16
|
+
...r
|
|
17
|
+
}
|
|
18
|
+
});
|
|
22
19
|
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { r as useListSessions };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthQueryOptions } from '../auth/use-auth-query';
|
|
3
3
|
/**
|
|
4
4
|
* Retrieve the passkeys registered for the current user.
|
|
5
5
|
*
|
|
@@ -8,4 +8,4 @@ import { type UseAuthQueryOptions } from "../auth/use-auth-query";
|
|
|
8
8
|
* @param options - Optional React Query options to customize the query behavior.
|
|
9
9
|
* @returns The React Query result for the passkeys list.
|
|
10
10
|
*/
|
|
11
|
-
export declare function useListUserPasskeys(options?: Partial<UseAuthQueryOptions<AuthClient["passkey"]["listUserPasskeys"]>>): import(
|
|
11
|
+
export declare function useListUserPasskeys(options?: Partial<UseAuthQueryOptions<AuthClient["passkey"]["listUserPasskeys"]>>): import('@tanstack/react-query').UseQueryResult<import('@better-auth/passkey/client').Passkey[] | null, import('better-auth/client').BetterFetchError>;
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
import { useAuthQuery } from "../auth/use-auth-query";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
...options
|
|
20
|
-
}
|
|
21
|
-
});
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { useAuthQuery as t } from "../auth/use-auth-query.js";
|
|
3
|
+
import { useSession as n } from "../auth/use-session.js";
|
|
4
|
+
//#region src/hooks/settings/use-list-user-passkeys.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { authClient: i } = e(), { data: a } = n({ refetchOnMount: !1 });
|
|
7
|
+
return t({
|
|
8
|
+
authFn: i.passkey.listUserPasskeys,
|
|
9
|
+
options: {
|
|
10
|
+
queryKey: [
|
|
11
|
+
"auth",
|
|
12
|
+
"listUserPasskeys",
|
|
13
|
+
a?.user.id
|
|
14
|
+
],
|
|
15
|
+
enabled: !!a,
|
|
16
|
+
...r
|
|
17
|
+
}
|
|
18
|
+
});
|
|
22
19
|
}
|
|
20
|
+
//#endregion
|
|
21
|
+
export { r as useListUserPasskeys };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthMutationOptions } from '../auth/use-auth-mutation';
|
|
3
3
|
/**
|
|
4
4
|
* Hook that creates a mutation for revoking a device session in multi-session mode.
|
|
5
5
|
*
|
|
6
6
|
* @returns The `useMutation` result.
|
|
7
7
|
*/
|
|
8
|
-
export declare function useRevokeMultiSession(options?: UseAuthMutationOptions<AuthClient["multiSession"]["revoke"]>): import(
|
|
8
|
+
export declare function useRevokeMultiSession(options?: UseAuthMutationOptions<AuthClient["multiSession"]["revoke"]>): import('../..').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
|
|
9
9
|
sessionToken: string;
|
|
10
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import(
|
|
10
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
|
|
11
11
|
sessionToken: string;
|
|
12
12
|
} & {
|
|
13
13
|
fetchOptions?: FetchOptions | undefined;
|
|
14
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import(
|
|
14
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
|
|
15
15
|
status: boolean;
|
|
16
16
|
}, {
|
|
17
17
|
code?: string | undefined;
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
await options?.onSuccess?.(...args);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
});
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { useAuthMutation as t } from "../auth/use-auth-mutation.js";
|
|
3
|
+
import { useListDeviceSessions as n } from "./use-list-device-sessions.js";
|
|
4
|
+
//#region src/hooks/settings/use-revoke-multi-session.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { authClient: i } = e(), { refetch: a } = n({ refetchOnMount: !1 });
|
|
7
|
+
return t({
|
|
8
|
+
authFn: i.multiSession.revoke,
|
|
9
|
+
options: {
|
|
10
|
+
...r,
|
|
11
|
+
onSuccess: async (...e) => {
|
|
12
|
+
await a(), await r?.onSuccess?.(...e);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
20
16
|
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as useRevokeMultiSession };
|