@better-auth-ui/react 1.6.1 → 1.6.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/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-authenticate.d.ts +30 -6
- package/dist/hooks/auth/use-authenticate.js +22 -27
- package/dist/hooks/auth/use-is-username-available.d.ts +20 -0
- package/dist/hooks/auth/use-is-username-available.js +13 -0
- package/dist/hooks/auth/use-request-password-reset.d.ts +12 -17
- package/dist/hooks/auth/use-request-password-reset.js +12 -13
- package/dist/hooks/auth/use-reset-password.d.ts +14 -31
- package/dist/hooks/auth/use-reset-password.js +12 -12
- package/dist/hooks/auth/use-send-verification-email.d.ts +11 -16
- package/dist/hooks/auth/use-send-verification-email.js +12 -12
- package/dist/hooks/auth/use-session.d.ts +31 -5
- package/dist/hooks/auth/use-session.js +15 -17
- package/dist/hooks/auth/use-sign-in-email.d.ts +12 -39
- package/dist/hooks/auth/use-sign-in-email.js +16 -24
- package/dist/hooks/auth/use-sign-in-magic-link.d.ts +15 -20
- package/dist/hooks/auth/use-sign-in-magic-link.js +12 -12
- package/dist/hooks/auth/use-sign-in-passkey.d.ts +13 -50
- package/dist/hooks/auth/use-sign-in-passkey.js +16 -24
- package/dist/hooks/auth/use-sign-in-social.d.ts +32 -62
- package/dist/hooks/auth/use-sign-in-social.js +12 -12
- package/dist/hooks/auth/use-sign-in-username.d.ts +25 -0
- package/dist/hooks/auth/use-sign-in-username.js +17 -0
- package/dist/hooks/auth/use-sign-out.d.ts +11 -12
- package/dist/hooks/auth/use-sign-out.js +15 -23
- package/dist/hooks/auth/use-sign-up-email.d.ts +178 -262
- package/dist/hooks/auth/use-sign-up-email.js +16 -24
- package/dist/hooks/auth/use-user.d.ts +63 -61
- package/dist/hooks/auth/use-user.js +10 -13
- package/dist/hooks/settings/use-account-info.d.ts +12 -12
- package/dist/hooks/settings/use-account-info.js +17 -24
- package/dist/hooks/settings/use-add-passkey.d.ts +11 -33
- package/dist/hooks/settings/use-add-passkey.js +16 -23
- package/dist/hooks/settings/use-change-email.d.ts +12 -15
- package/dist/hooks/settings/use-change-email.js +16 -22
- package/dist/hooks/settings/use-change-password.d.ts +12 -45
- package/dist/hooks/settings/use-change-password.js +12 -10
- package/dist/hooks/settings/use-delete-passkey.d.ts +11 -13
- package/dist/hooks/settings/use-delete-passkey.js +16 -23
- package/dist/hooks/settings/use-delete-user.d.ts +14 -32
- package/dist/hooks/settings/use-delete-user.js +12 -10
- package/dist/hooks/settings/use-link-social.d.ts +23 -26
- package/dist/hooks/settings/use-link-social.js +12 -9
- package/dist/hooks/settings/use-list-accounts.d.ts +10 -8
- package/dist/hooks/settings/use-list-accounts.js +14 -22
- package/dist/hooks/settings/use-list-device-sessions.d.ts +30 -7
- package/dist/hooks/settings/use-list-device-sessions.js +14 -21
- package/dist/hooks/settings/use-list-sessions.d.ts +10 -7
- package/dist/hooks/settings/use-list-sessions.js +14 -21
- package/dist/hooks/settings/use-list-user-passkeys.d.ts +9 -6
- package/dist/hooks/settings/use-list-user-passkeys.js +14 -21
- package/dist/hooks/settings/use-revoke-multi-session.d.ts +12 -12
- package/dist/hooks/settings/use-revoke-multi-session.js +16 -19
- package/dist/hooks/settings/use-revoke-session.d.ts +12 -12
- package/dist/hooks/settings/use-revoke-session.js +16 -20
- package/dist/hooks/settings/use-set-active-session.d.ts +13 -30
- package/dist/hooks/settings/use-set-active-session.js +19 -27
- package/dist/hooks/settings/use-unlink-account.d.ts +13 -13
- package/dist/hooks/settings/use-unlink-account.js +16 -20
- package/dist/hooks/settings/use-update-user.d.ts +1179 -5
- package/dist/hooks/settings/use-update-user.js +23 -28
- package/dist/hooks/use-auth-mutation.d.ts +12 -0
- package/dist/hooks/use-auth-mutation.js +11 -0
- package/dist/hooks/use-auth-query.d.ts +14 -0
- package/dist/hooks/use-auth-query.js +15 -0
- 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/dist/mutations/auth/is-username-available-options.d.ts +19 -0
- package/dist/mutations/auth/is-username-available-options.js +7 -0
- package/dist/mutations/auth/request-password-reset-options.d.ts +15 -0
- package/dist/mutations/auth/request-password-reset-options.js +7 -0
- package/dist/mutations/auth/reset-password-options.d.ts +17 -0
- package/dist/mutations/auth/reset-password-options.js +7 -0
- package/dist/mutations/auth/send-verification-email-options.d.ts +15 -0
- package/dist/mutations/auth/send-verification-email-options.js +7 -0
- package/dist/mutations/auth/sign-in-email-options.d.ts +23 -0
- package/dist/mutations/auth/sign-in-email-options.js +11 -0
- package/dist/mutations/auth/sign-in-magic-link-options.d.ts +23 -0
- package/dist/mutations/auth/sign-in-magic-link-options.js +11 -0
- package/dist/mutations/auth/sign-in-passkey-options.d.ts +15 -0
- package/dist/mutations/auth/sign-in-passkey-options.js +11 -0
- package/dist/mutations/auth/sign-in-social-options.d.ts +61 -0
- package/dist/mutations/auth/sign-in-social-options.js +11 -0
- package/dist/mutations/auth/sign-in-username-options.d.ts +19 -0
- package/dist/mutations/auth/sign-in-username-options.js +11 -0
- package/dist/mutations/auth/sign-out-options.d.ts +12 -0
- package/dist/mutations/auth/sign-out-options.js +7 -0
- package/dist/mutations/auth/sign-up-email-options.d.ts +1180 -0
- package/dist/mutations/auth/sign-up-email-options.js +11 -0
- package/dist/mutations/auth-mutation-options.d.ts +25 -0
- package/dist/mutations/auth-mutation-options.js +19 -0
- package/dist/mutations/settings/add-passkey-options.d.ts +15 -0
- package/dist/mutations/settings/add-passkey-options.js +11 -0
- package/dist/mutations/settings/change-email-options.d.ts +15 -0
- package/dist/mutations/settings/change-email-options.js +7 -0
- package/dist/mutations/settings/change-password-options.d.ts +17 -0
- package/dist/mutations/settings/change-password-options.js +7 -0
- package/dist/mutations/settings/delete-passkey-options.d.ts +13 -0
- package/dist/mutations/settings/delete-passkey-options.js +11 -0
- package/dist/mutations/settings/delete-user-options.d.ts +20 -0
- package/dist/mutations/settings/delete-user-options.js +7 -0
- package/dist/mutations/settings/link-social-options.d.ts +39 -0
- package/dist/mutations/settings/link-social-options.js +7 -0
- package/dist/mutations/settings/revoke-multi-session-options.d.ts +13 -0
- package/dist/mutations/settings/revoke-multi-session-options.js +11 -0
- package/dist/mutations/settings/revoke-session-options.d.ts +13 -0
- package/dist/mutations/settings/revoke-session-options.js +7 -0
- package/dist/mutations/settings/set-active-session-options.d.ts +13 -0
- package/dist/mutations/settings/set-active-session-options.js +11 -0
- package/dist/mutations/settings/unlink-account-options.d.ts +15 -0
- package/dist/mutations/settings/unlink-account-options.js +7 -0
- package/dist/mutations/settings/update-user-options.d.ts +1182 -0
- package/dist/mutations/settings/update-user-options.js +7 -0
- package/dist/queries/auth/session-options.d.ts +110 -0
- package/dist/queries/auth/session-options.js +7 -0
- package/dist/queries/auth-query-options.d.ts +29 -0
- package/dist/queries/auth-query-options.js +17 -0
- package/dist/queries/settings/account-info-options.d.ts +32 -0
- package/dist/queries/settings/account-info-options.js +12 -0
- package/dist/queries/settings/list-accounts-options.d.ts +53 -0
- package/dist/queries/settings/list-accounts-options.js +12 -0
- package/dist/queries/settings/list-device-sessions-options.d.ts +99 -0
- package/dist/queries/settings/list-device-sessions-options.js +12 -0
- package/dist/queries/settings/list-sessions-options.d.ts +54 -0
- package/dist/queries/settings/list-sessions-options.js +12 -0
- package/dist/queries/settings/list-user-passkeys-options.d.ts +18 -0
- package/dist/queries/settings/list-user-passkeys-options.js +12 -0
- package/package.json +11 -11
- package/src/components/auth/auth-provider.tsx +4 -6
- package/src/hooks/auth/use-authenticate.ts +8 -9
- package/src/hooks/auth/use-is-username-available.ts +31 -0
- package/src/hooks/auth/use-request-password-reset.ts +20 -11
- package/src/hooks/auth/use-reset-password.ts +20 -12
- package/src/hooks/auth/use-send-verification-email.ts +19 -11
- package/src/hooks/auth/use-session.ts +22 -17
- package/src/hooks/auth/use-sign-in-email.ts +24 -19
- package/src/hooks/auth/use-sign-in-magic-link.ts +19 -13
- package/src/hooks/auth/use-sign-in-passkey.ts +24 -18
- package/src/hooks/auth/use-sign-in-social.ts +19 -11
- package/src/hooks/auth/use-sign-in-username.ts +40 -0
- package/src/hooks/auth/use-sign-out.ts +20 -20
- package/src/hooks/auth/use-sign-up-email.ts +25 -21
- package/src/hooks/auth/use-user.ts +7 -9
- package/src/hooks/settings/use-account-info.ts +31 -21
- package/src/hooks/settings/use-add-passkey.ts +22 -17
- package/src/hooks/settings/use-change-email.ts +24 -20
- package/src/hooks/settings/use-change-password.ts +19 -11
- package/src/hooks/settings/use-delete-passkey.ts +21 -16
- package/src/hooks/settings/use-delete-user.ts +19 -11
- package/src/hooks/settings/use-link-social.ts +20 -10
- package/src/hooks/settings/use-list-accounts.ts +28 -16
- package/src/hooks/settings/use-list-device-sessions.ts +29 -22
- package/src/hooks/settings/use-list-sessions.ts +28 -15
- package/src/hooks/settings/use-list-user-passkeys.ts +28 -17
- package/src/hooks/settings/use-revoke-multi-session.ts +28 -19
- package/src/hooks/settings/use-revoke-session.ts +26 -18
- package/src/hooks/settings/use-set-active-session.ts +40 -28
- package/src/hooks/settings/use-unlink-account.ts +23 -17
- package/src/hooks/settings/use-update-user.ts +33 -27
- package/src/hooks/use-auth-mutation.ts +29 -0
- package/src/hooks/use-auth-query.ts +36 -0
- package/src/index.ts +4 -0
- package/src/lib/auth-config.ts +1 -1
- package/src/mutations/auth/is-username-available-options.ts +18 -0
- package/src/mutations/auth/request-password-reset-options.ts +14 -0
- package/src/mutations/auth/reset-password-options.ts +14 -0
- package/src/mutations/auth/send-verification-email-options.ts +14 -0
- package/src/mutations/auth/sign-in-email-options.ts +19 -0
- package/src/mutations/auth/sign-in-magic-link-options.ts +15 -0
- package/src/mutations/auth/sign-in-passkey-options.ts +15 -0
- package/src/mutations/auth/sign-in-social-options.ts +19 -0
- package/src/mutations/auth/sign-in-username-options.ts +15 -0
- package/src/mutations/auth/sign-out-options.ts +11 -0
- package/src/mutations/auth/sign-up-email-options.ts +15 -0
- package/src/mutations/auth-mutation-options.ts +49 -0
- package/src/mutations/settings/add-passkey-options.ts +15 -0
- package/src/mutations/settings/change-email-options.ts +11 -0
- package/src/mutations/settings/change-password-options.ts +14 -0
- package/src/mutations/settings/delete-passkey-options.ts +15 -0
- package/src/mutations/settings/delete-user-options.ts +11 -0
- package/src/mutations/settings/link-social-options.ts +11 -0
- package/src/mutations/settings/revoke-multi-session-options.ts +15 -0
- package/src/mutations/settings/revoke-session-options.ts +14 -0
- package/src/mutations/settings/set-active-session-options.ts +15 -0
- package/src/mutations/settings/unlink-account-options.ts +14 -0
- package/src/mutations/settings/update-user-options.ts +15 -0
- package/src/queries/auth/session-options.ts +18 -0
- package/src/queries/auth-query-options.ts +34 -0
- package/src/queries/settings/account-info-options.ts +25 -0
- package/src/queries/settings/list-accounts-options.ts +26 -0
- package/src/queries/settings/list-device-sessions-options.ts +24 -0
- package/src/queries/settings/list-sessions-options.ts +23 -0
- package/src/queries/settings/list-user-passkeys-options.ts +23 -0
- package/dist/hooks/auth/use-auth-mutation.d.ts +0 -18
- package/dist/hooks/auth/use-auth-mutation.js +0 -10
- package/dist/hooks/auth/use-auth-query.d.ts +0 -24
- package/dist/hooks/auth/use-auth-query.js +0 -10
- package/dist/lib/auth-config.js +0 -1
- package/src/hooks/auth/use-auth-mutation.ts +0 -56
- package/src/hooks/auth/use-auth-query.ts +0 -50
|
@@ -1,24 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { sendVerificationEmailOptions } from '../../mutations/auth/send-verification-email-options';
|
|
3
|
+
export type UseSendVerificationEmailParams = NonNullable<Parameters<AuthClient["sendVerificationEmail"]>[0]>;
|
|
4
|
+
export type UseSendVerificationEmailOptions = Omit<ReturnType<typeof sendVerificationEmailOptions>, "mutationKey" | "mutationFn">;
|
|
4
5
|
/**
|
|
5
6
|
* Hook that creates a mutation to send a verification email.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* @param options - React Query options forwarded to `useMutation`.
|
|
9
9
|
* @returns The `useMutation` result.
|
|
10
10
|
*/
|
|
11
|
-
export declare function useSendVerificationEmail(options?:
|
|
12
|
-
email: string;
|
|
13
|
-
callbackURL?: string | undefined;
|
|
14
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
11
|
+
export declare function useSendVerificationEmail(options?: UseSendVerificationEmailOptions): import('@tanstack/react-query').UseMutationResult<never, import('better-auth/client').BetterFetchError, import('better-auth').Prettify<{
|
|
15
12
|
email: string;
|
|
16
13
|
callbackURL?: string | undefined;
|
|
17
14
|
} & {
|
|
18
|
-
fetchOptions?:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
message?: string | undefined;
|
|
24
|
-
}, FetchOptions["throw"] extends true ? true : false>>)>;
|
|
15
|
+
fetchOptions?: import('better-auth').ClientFetchOption<Partial<{
|
|
16
|
+
email: string;
|
|
17
|
+
callbackURL?: string | undefined;
|
|
18
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
|
|
19
|
+
}>, unknown>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const { authClient } = useAuth();
|
|
12
|
-
return useAuthMutation({ authFn: authClient.sendVerificationEmail, options });
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { sendVerificationEmailOptions as t } from "../../mutations/auth/send-verification-email-options.js";
|
|
3
|
+
import { useMutation as n } from "@tanstack/react-query";
|
|
4
|
+
//#region src/hooks/auth/use-send-verification-email.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { authClient: i } = e();
|
|
7
|
+
return n({
|
|
8
|
+
...t(i),
|
|
9
|
+
...r
|
|
10
|
+
});
|
|
13
11
|
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as useSendVerificationEmail };
|
|
@@ -1,9 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { sessionOptions } from '../../queries/auth/session-options';
|
|
3
|
+
export type UseSessionParams = NonNullable<Parameters<AuthClient["getSession"]>[0]>;
|
|
4
|
+
export type UseSessionOptions = Omit<ReturnType<typeof sessionOptions>, "queryKey" | "queryFn"> & UseSessionParams;
|
|
3
5
|
/**
|
|
4
6
|
* Retrieve the current authentication session.
|
|
5
7
|
*
|
|
6
|
-
* @param options -
|
|
7
|
-
*
|
|
8
|
+
* @param options - Better Auth params (`query`, `fetchOptions`) and React
|
|
9
|
+
* Query options forwarded to `useQuery`.
|
|
10
|
+
* @returns React Query result for the session.
|
|
8
11
|
*/
|
|
9
|
-
export declare function useSession(options?:
|
|
12
|
+
export declare function useSession(options?: UseSessionOptions): import('@tanstack/react-query').UseQueryResult<{
|
|
13
|
+
user: import('better-auth').StripEmptyObjects<{
|
|
14
|
+
id: string;
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
updatedAt: Date;
|
|
17
|
+
email: string;
|
|
18
|
+
emailVerified: boolean;
|
|
19
|
+
name: string;
|
|
20
|
+
image?: string | null | undefined;
|
|
21
|
+
} & {} & {
|
|
22
|
+
username?: string | null | undefined;
|
|
23
|
+
displayUsername?: string | null | undefined;
|
|
24
|
+
}>;
|
|
25
|
+
session: import('better-auth').StripEmptyObjects<{
|
|
26
|
+
id: string;
|
|
27
|
+
createdAt: Date;
|
|
28
|
+
updatedAt: Date;
|
|
29
|
+
userId: string;
|
|
30
|
+
expiresAt: Date;
|
|
31
|
+
token: string;
|
|
32
|
+
ipAddress?: string | null | undefined;
|
|
33
|
+
userAgent?: string | null | undefined;
|
|
34
|
+
}>;
|
|
35
|
+
} | null, import('better-auth/client').BetterFetchError>;
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { useAuth } from "
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
queryKey: ["auth", "getSession"],
|
|
15
|
-
...options
|
|
16
|
-
}
|
|
17
|
-
});
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { sessionOptions as t } from "../../queries/auth/session-options.js";
|
|
3
|
+
import { useQuery as n } from "@tanstack/react-query";
|
|
4
|
+
//#region src/hooks/auth/use-session.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { authClient: i } = e(), { query: a, fetchOptions: o, ...s } = r ?? {};
|
|
7
|
+
return n({
|
|
8
|
+
...t(i, {
|
|
9
|
+
query: a,
|
|
10
|
+
fetchOptions: o
|
|
11
|
+
}),
|
|
12
|
+
...s
|
|
13
|
+
});
|
|
18
14
|
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { r as useSession };
|
|
@@ -1,53 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { signInEmailOptions } from '../../mutations/auth/sign-in-email-options';
|
|
3
|
+
export type UseSignInEmailParams = NonNullable<Parameters<AuthClient["signIn"]["email"]>[0]>;
|
|
4
|
+
export type UseSignInEmailOptions = Omit<ReturnType<typeof signInEmailOptions>, "mutationKey" | "mutationFn">;
|
|
4
5
|
/**
|
|
5
6
|
* Hook that creates a mutation for email/password sign-in.
|
|
6
7
|
*
|
|
7
8
|
* The mutation sends an email/password sign-in request and
|
|
8
9
|
* refetches the session on completion.
|
|
9
10
|
*
|
|
11
|
+
* @param options - React Query options forwarded to `useMutation`.
|
|
10
12
|
* @returns The `useMutation` result.
|
|
11
13
|
*/
|
|
12
|
-
export declare function useSignInEmail(options?:
|
|
13
|
-
email: string;
|
|
14
|
-
password: string;
|
|
15
|
-
callbackURL?: string | undefined;
|
|
16
|
-
rememberMe?: boolean | undefined;
|
|
17
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
14
|
+
export declare function useSignInEmail(options?: UseSignInEmailOptions): import('@tanstack/react-query').UseMutationResult<never, import('better-auth/client').BetterFetchError, import('better-auth').Prettify<{
|
|
18
15
|
email: string;
|
|
19
16
|
password: string;
|
|
20
17
|
callbackURL?: string | undefined;
|
|
21
18
|
rememberMe?: boolean | undefined;
|
|
22
19
|
} & {
|
|
23
|
-
fetchOptions?:
|
|
24
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<Omit<{
|
|
25
|
-
redirect: boolean;
|
|
26
|
-
token: string;
|
|
27
|
-
url?: string | undefined;
|
|
28
|
-
user: {
|
|
29
|
-
id: string;
|
|
30
|
-
createdAt: Date;
|
|
31
|
-
updatedAt: Date;
|
|
32
|
-
email: string;
|
|
33
|
-
emailVerified: boolean;
|
|
34
|
-
name: string;
|
|
35
|
-
image?: string | null | undefined | undefined;
|
|
36
|
-
};
|
|
37
|
-
}, "user"> & {
|
|
38
|
-
user: import("better-auth").StripEmptyObjects<{
|
|
39
|
-
id: string;
|
|
40
|
-
createdAt: Date;
|
|
41
|
-
updatedAt: Date;
|
|
20
|
+
fetchOptions?: import('better-auth').ClientFetchOption<Partial<{
|
|
42
21
|
email: string;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
} &
|
|
47
|
-
|
|
48
|
-
displayUsername?: string | null | undefined;
|
|
49
|
-
}>;
|
|
50
|
-
}, {
|
|
51
|
-
code?: string | undefined;
|
|
52
|
-
message?: string | undefined;
|
|
53
|
-
}, FetchOptions["throw"] extends true ? true : false>>)>;
|
|
22
|
+
password: string;
|
|
23
|
+
callbackURL?: string | undefined;
|
|
24
|
+
rememberMe?: boolean | undefined;
|
|
25
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
|
|
26
|
+
}>, unknown>;
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return useAuthMutation({
|
|
16
|
-
authFn: authClient.signIn.email,
|
|
17
|
-
options: {
|
|
18
|
-
...options,
|
|
19
|
-
onSuccess: async (...args) => {
|
|
20
|
-
queryClient.resetQueries({ queryKey: ["auth", "getSession"] });
|
|
21
|
-
await options?.onSuccess?.(...args);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
});
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { sessionOptions as t } from "../../queries/auth/session-options.js";
|
|
3
|
+
import { signInEmailOptions as n } from "../../mutations/auth/sign-in-email-options.js";
|
|
4
|
+
import { useMutation as r, useQueryClient as i } from "@tanstack/react-query";
|
|
5
|
+
//#region src/hooks/auth/use-sign-in-email.ts
|
|
6
|
+
function a(a) {
|
|
7
|
+
let { authClient: o } = e(), s = i();
|
|
8
|
+
return r({
|
|
9
|
+
...n(o),
|
|
10
|
+
...a,
|
|
11
|
+
onSuccess: async (...e) => {
|
|
12
|
+
s.resetQueries({ queryKey: t(o).queryKey }), await a?.onSuccess?.(...e);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
25
15
|
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { a as useSignInEmail };
|
|
@@ -1,21 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { signInMagicLinkOptions } from '../../mutations/auth/sign-in-magic-link-options';
|
|
3
|
+
export type UseSignInMagicLinkParams = NonNullable<Parameters<AuthClient["signIn"]["magicLink"]>[0]>;
|
|
4
|
+
export type UseSignInMagicLinkOptions = Omit<ReturnType<typeof signInMagicLinkOptions>, "mutationKey" | "mutationFn">;
|
|
4
5
|
/**
|
|
5
6
|
* Hook that creates a mutation for magic-link sign-in.
|
|
6
7
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
8
|
+
* @param options - React Query options forwarded to `useMutation`.
|
|
9
9
|
* @returns The `useMutation` result.
|
|
10
10
|
*/
|
|
11
|
-
export declare function useSignInMagicLink(options?:
|
|
12
|
-
email: string;
|
|
13
|
-
name?: string | undefined;
|
|
14
|
-
callbackURL?: string | undefined;
|
|
15
|
-
newUserCallbackURL?: string | undefined;
|
|
16
|
-
errorCallbackURL?: string | undefined;
|
|
17
|
-
metadata?: Record<string, any> | undefined;
|
|
18
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import("better-auth").Prettify<{
|
|
11
|
+
export declare function useSignInMagicLink(options?: UseSignInMagicLinkOptions): import('@tanstack/react-query').UseMutationResult<never, import('better-auth/client').BetterFetchError, import('better-auth').Prettify<{
|
|
19
12
|
email: string;
|
|
20
13
|
name?: string | undefined;
|
|
21
14
|
callbackURL?: string | undefined;
|
|
@@ -23,10 +16,12 @@ export declare function useSignInMagicLink(options?: UseAuthMutationOptions<Auth
|
|
|
23
16
|
errorCallbackURL?: string | undefined;
|
|
24
17
|
metadata?: Record<string, any> | undefined;
|
|
25
18
|
} & {
|
|
26
|
-
fetchOptions?:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
fetchOptions?: import('better-auth').ClientFetchOption<Partial<{
|
|
20
|
+
email: string;
|
|
21
|
+
name?: string | undefined;
|
|
22
|
+
callbackURL?: string | undefined;
|
|
23
|
+
newUserCallbackURL?: string | undefined;
|
|
24
|
+
errorCallbackURL?: string | undefined;
|
|
25
|
+
metadata?: Record<string, any> | undefined;
|
|
26
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
|
|
27
|
+
}>, unknown>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const { authClient } = useAuth();
|
|
12
|
-
return useAuthMutation({ authFn: authClient.signIn.magicLink, options });
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { signInMagicLinkOptions as t } from "../../mutations/auth/sign-in-magic-link-options.js";
|
|
3
|
+
import { useMutation as n } from "@tanstack/react-query";
|
|
4
|
+
//#region src/hooks/auth/use-sign-in-magic-link.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { authClient: i } = e();
|
|
7
|
+
return n({
|
|
8
|
+
...t(i),
|
|
9
|
+
...r
|
|
10
|
+
});
|
|
13
11
|
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as useSignInMagicLink };
|
|
@@ -1,58 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { signInPasskeyOptions } from '../../mutations/auth/sign-in-passkey-options';
|
|
3
|
+
export type UseSignInPasskeyParams = NonNullable<Parameters<AuthClient["signIn"]["passkey"]>[0]>;
|
|
4
|
+
export type UseSignInPasskeyOptions = Omit<ReturnType<typeof signInPasskeyOptions>, "mutationKey" | "mutationFn">;
|
|
3
5
|
/**
|
|
4
6
|
* Hook that creates a mutation for passkey sign-in.
|
|
5
7
|
*
|
|
6
|
-
*
|
|
7
|
-
* refetches the session on completion.
|
|
8
|
+
* Resets the session query on completion so the new session is refetched.
|
|
8
9
|
*
|
|
10
|
+
* @param options - React Query options forwarded to `useMutation`.
|
|
9
11
|
* @returns The `useMutation` result.
|
|
10
12
|
*/
|
|
11
|
-
export declare function useSignInPasskey(options?:
|
|
13
|
+
export declare function useSignInPasskey(options?: UseSignInPasskeyOptions): import('@tanstack/react-query').UseMutationResult<{
|
|
14
|
+
session: import('better-auth').Session;
|
|
15
|
+
user: import('better-auth').User;
|
|
16
|
+
} | null, import('better-auth/client').BetterFetchError, void | {
|
|
12
17
|
autoFill?: boolean;
|
|
13
|
-
extensions?: import(
|
|
18
|
+
extensions?: import('@better-auth/passkey/client').AuthenticationExtensionsClientInputs;
|
|
14
19
|
returnWebAuthnResponse?: boolean;
|
|
15
|
-
fetchOptions?: import(
|
|
16
|
-
}
|
|
17
|
-
data: null;
|
|
18
|
-
error: {
|
|
19
|
-
message?: string | undefined;
|
|
20
|
-
status: number;
|
|
21
|
-
statusText: string;
|
|
22
|
-
};
|
|
23
|
-
} | {
|
|
24
|
-
data: {
|
|
25
|
-
session: import("better-auth").Session;
|
|
26
|
-
user: import("better-auth").User;
|
|
27
|
-
};
|
|
28
|
-
error: null;
|
|
29
|
-
} | {
|
|
30
|
-
webauthn: {
|
|
31
|
-
response: import("@better-auth/passkey/client").AuthenticationResponseJSON;
|
|
32
|
-
clientExtensionResults: import("@better-auth/passkey/client").AuthenticationExtensionsClientOutputs;
|
|
33
|
-
};
|
|
34
|
-
data: null;
|
|
35
|
-
error: {
|
|
36
|
-
message?: string | undefined;
|
|
37
|
-
status: number;
|
|
38
|
-
statusText: string;
|
|
39
|
-
};
|
|
40
|
-
} | {
|
|
41
|
-
webauthn: {
|
|
42
|
-
response: import("@better-auth/passkey/client").AuthenticationResponseJSON;
|
|
43
|
-
clientExtensionResults: import("@better-auth/passkey/client").AuthenticationExtensionsClientOutputs;
|
|
44
|
-
};
|
|
45
|
-
data: {
|
|
46
|
-
session: import("better-auth").Session;
|
|
47
|
-
user: import("better-auth").User;
|
|
48
|
-
};
|
|
49
|
-
error: null;
|
|
50
|
-
} | {
|
|
51
|
-
data: null;
|
|
52
|
-
error: {
|
|
53
|
-
code: string;
|
|
54
|
-
message: string;
|
|
55
|
-
status: number;
|
|
56
|
-
statusText: string;
|
|
57
|
-
};
|
|
58
|
-
}>>;
|
|
20
|
+
fetchOptions?: import('better-auth').ClientFetchOption;
|
|
21
|
+
}, unknown>;
|
|
@@ -1,25 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
return useAuthMutation({
|
|
16
|
-
authFn: authClient.signIn.passkey,
|
|
17
|
-
options: {
|
|
18
|
-
...options,
|
|
19
|
-
onSuccess: async (...args) => {
|
|
20
|
-
queryClient.resetQueries({ queryKey: ["auth", "getSession"] });
|
|
21
|
-
await options?.onSuccess?.(...args);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
});
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { sessionOptions as t } from "../../queries/auth/session-options.js";
|
|
3
|
+
import { signInPasskeyOptions as n } from "../../mutations/auth/sign-in-passkey-options.js";
|
|
4
|
+
import { useMutation as r, useQueryClient as i } from "@tanstack/react-query";
|
|
5
|
+
//#region src/hooks/auth/use-sign-in-passkey.ts
|
|
6
|
+
function a(a) {
|
|
7
|
+
let { authClient: o } = e(), s = i();
|
|
8
|
+
return r({
|
|
9
|
+
...n(o),
|
|
10
|
+
...a,
|
|
11
|
+
onSuccess: async (...e) => {
|
|
12
|
+
s.resetQueries({ queryKey: t(o).queryKey }), await a?.onSuccess?.(...e);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
25
15
|
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { a as useSignInPasskey };
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { signInSocialOptions } from '../../mutations/auth/sign-in-social-options';
|
|
3
|
+
export type UseSignInSocialParams = NonNullable<Parameters<AuthClient["signIn"]["social"]>[0]>;
|
|
4
|
+
export type UseSignInSocialOptions = Omit<ReturnType<typeof signInSocialOptions>, "mutationKey" | "mutationFn">;
|
|
4
5
|
/**
|
|
5
6
|
* Hook that creates a mutation for social sign-in.
|
|
6
7
|
*
|
|
7
8
|
* The mutation initiates a social sign-in flow with the specified provider.
|
|
8
9
|
*
|
|
10
|
+
* @param options - React Query options forwarded to `useMutation`.
|
|
9
11
|
* @returns The `useMutation` result.
|
|
10
12
|
*/
|
|
11
|
-
export declare function useSignInSocial(options?:
|
|
12
|
-
provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "
|
|
13
|
+
export declare function useSignInSocial(options?: UseSignInSocialOptions): import('@tanstack/react-query').UseMutationResult<never, import('better-auth/client').BetterFetchError, import('better-auth').Prettify<{
|
|
14
|
+
provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
|
|
13
15
|
callbackURL?: string | undefined;
|
|
14
16
|
newUserCallbackURL?: string | undefined;
|
|
15
17
|
errorCallbackURL?: string | undefined;
|
|
@@ -32,62 +34,30 @@ export declare function useSignInSocial(options?: UseAuthMutationOptions<AuthCli
|
|
|
32
34
|
requestSignUp?: boolean | undefined;
|
|
33
35
|
loginHint?: string | undefined;
|
|
34
36
|
additionalData?: Record<string, any> | undefined;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
37
|
+
} & {
|
|
38
|
+
fetchOptions?: import('better-auth').ClientFetchOption<Partial<{
|
|
39
|
+
provider: (string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat";
|
|
40
|
+
callbackURL?: string | undefined;
|
|
41
|
+
newUserCallbackURL?: string | undefined;
|
|
42
|
+
errorCallbackURL?: string | undefined;
|
|
43
|
+
disableRedirect?: boolean | undefined;
|
|
44
|
+
idToken?: {
|
|
45
|
+
token: string;
|
|
46
|
+
nonce?: string | undefined;
|
|
47
|
+
accessToken?: string | undefined;
|
|
48
|
+
refreshToken?: string | undefined;
|
|
49
|
+
expiresAt?: number | undefined;
|
|
50
|
+
user?: {
|
|
51
|
+
name?: {
|
|
52
|
+
firstName?: string | undefined;
|
|
53
|
+
lastName?: string | undefined;
|
|
54
|
+
} | undefined;
|
|
55
|
+
email?: string | undefined;
|
|
51
56
|
} | undefined;
|
|
52
|
-
email?: string | undefined;
|
|
53
57
|
} | undefined;
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
fetchOptions?: FetchOptions | undefined;
|
|
61
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import("better-auth/react").BetterFetchResponse<{
|
|
62
|
-
redirect: boolean;
|
|
63
|
-
url: string;
|
|
64
|
-
} | (Omit<{
|
|
65
|
-
redirect: boolean;
|
|
66
|
-
token: string;
|
|
67
|
-
url: undefined;
|
|
68
|
-
user: {
|
|
69
|
-
id: string;
|
|
70
|
-
createdAt: Date;
|
|
71
|
-
updatedAt: Date;
|
|
72
|
-
email: string;
|
|
73
|
-
emailVerified: boolean;
|
|
74
|
-
name: string;
|
|
75
|
-
image?: string | null | undefined | undefined;
|
|
76
|
-
};
|
|
77
|
-
}, "user"> & {
|
|
78
|
-
user: import("better-auth").StripEmptyObjects<{
|
|
79
|
-
id: string;
|
|
80
|
-
createdAt: Date;
|
|
81
|
-
updatedAt: Date;
|
|
82
|
-
email: string;
|
|
83
|
-
emailVerified: boolean;
|
|
84
|
-
name: string;
|
|
85
|
-
image?: string | null | undefined;
|
|
86
|
-
} & {} & {
|
|
87
|
-
username?: string | null | undefined;
|
|
88
|
-
displayUsername?: string | null | undefined;
|
|
89
|
-
}>;
|
|
90
|
-
}), {
|
|
91
|
-
code?: string | undefined;
|
|
92
|
-
message?: string | undefined;
|
|
93
|
-
}, FetchOptions["throw"] extends true ? true : false>>)>;
|
|
58
|
+
scopes?: string[] | undefined;
|
|
59
|
+
requestSignUp?: boolean | undefined;
|
|
60
|
+
loginHint?: string | undefined;
|
|
61
|
+
additionalData?: Record<string, any> | undefined;
|
|
62
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
|
|
63
|
+
}>, unknown>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const { authClient } = useAuth();
|
|
12
|
-
return useAuthMutation({ authFn: authClient.signIn.social, options });
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { signInSocialOptions as t } from "../../mutations/auth/sign-in-social-options.js";
|
|
3
|
+
import { useMutation as n } from "@tanstack/react-query";
|
|
4
|
+
//#region src/hooks/auth/use-sign-in-social.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { authClient: i } = e();
|
|
7
|
+
return n({
|
|
8
|
+
...t(i),
|
|
9
|
+
...r
|
|
10
|
+
});
|
|
13
11
|
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as useSignInSocial };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { signInUsernameOptions } from '../../mutations/auth/sign-in-username-options';
|
|
3
|
+
export type UseSignInUsernameParams = NonNullable<Parameters<AuthClient["signIn"]["username"]>[0]>;
|
|
4
|
+
export type UseSignInUsernameOptions = Omit<ReturnType<typeof signInUsernameOptions>, "mutationKey" | "mutationFn">;
|
|
5
|
+
/**
|
|
6
|
+
* Hook that creates a mutation for username/password sign-in.
|
|
7
|
+
*
|
|
8
|
+
* Resets the session query on completion so the new session is refetched.
|
|
9
|
+
*
|
|
10
|
+
* @param options - React Query options forwarded to `useMutation`.
|
|
11
|
+
* @returns The `useMutation` result.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useSignInUsername(options?: UseSignInUsernameOptions): import('@tanstack/react-query').UseMutationResult<never, import('better-auth/client').BetterFetchError, import('better-auth').Prettify<{
|
|
14
|
+
username: string;
|
|
15
|
+
password: string;
|
|
16
|
+
rememberMe?: boolean | undefined;
|
|
17
|
+
callbackURL?: string | undefined;
|
|
18
|
+
} & {
|
|
19
|
+
fetchOptions?: import('better-auth').ClientFetchOption<Partial<{
|
|
20
|
+
username: string;
|
|
21
|
+
password: string;
|
|
22
|
+
rememberMe?: boolean | undefined;
|
|
23
|
+
callbackURL?: string | undefined;
|
|
24
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined> | undefined;
|
|
25
|
+
}>, unknown>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { sessionOptions as t } from "../../queries/auth/session-options.js";
|
|
3
|
+
import { signInUsernameOptions as n } from "../../mutations/auth/sign-in-username-options.js";
|
|
4
|
+
import { useMutation as r, useQueryClient as i } from "@tanstack/react-query";
|
|
5
|
+
//#region src/hooks/auth/use-sign-in-username.ts
|
|
6
|
+
function a(a) {
|
|
7
|
+
let { authClient: o } = e(), s = i();
|
|
8
|
+
return r({
|
|
9
|
+
...n(o),
|
|
10
|
+
...a,
|
|
11
|
+
onSuccess: async (...e) => {
|
|
12
|
+
s.resetQueries({ queryKey: t(o).queryKey }), await a?.onSuccess?.(...e);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { a as useSignInUsername };
|