@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,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export { useAuthMutation } from "./use-auth-mutation";
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthMutationOptions } from './use-auth-mutation';
|
|
4
3
|
/**
|
|
5
4
|
* Hook that creates a mutation to send a verification email.
|
|
6
5
|
*
|
|
@@ -8,15 +7,15 @@ export { useAuthMutation } from "./use-auth-mutation";
|
|
|
8
7
|
*
|
|
9
8
|
* @returns The `useMutation` result.
|
|
10
9
|
*/
|
|
11
|
-
export declare function useSendVerificationEmail(options?: UseAuthMutationOptions<AuthClient["sendVerificationEmail"]>): import(
|
|
10
|
+
export declare function useSendVerificationEmail(options?: UseAuthMutationOptions<AuthClient["sendVerificationEmail"]>): import('./use-auth-mutation').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
|
|
12
11
|
email: string;
|
|
13
12
|
callbackURL?: string | undefined;
|
|
14
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import(
|
|
13
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
|
|
15
14
|
email: string;
|
|
16
15
|
callbackURL?: string | 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<{
|
|
20
19
|
status: boolean;
|
|
21
20
|
}, {
|
|
22
21
|
code?: string | undefined;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export function useSendVerificationEmail(options) {
|
|
11
|
-
const { authClient } = useAuth();
|
|
12
|
-
return useAuthMutation({ authFn: authClient.sendVerificationEmail, options });
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { useAuthMutation as t } from "./use-auth-mutation.js";
|
|
3
|
+
//#region src/hooks/auth/use-send-verification-email.ts
|
|
4
|
+
function n(n) {
|
|
5
|
+
let { authClient: r } = e();
|
|
6
|
+
return t({
|
|
7
|
+
authFn: r.sendVerificationEmail,
|
|
8
|
+
options: n
|
|
9
|
+
});
|
|
13
10
|
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as useSendVerificationEmail };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthQueryOptions, UseAuthQueryResult } from './use-auth-query';
|
|
3
3
|
/**
|
|
4
4
|
* Retrieve the current authentication session.
|
|
5
5
|
*
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { useAuth } from "
|
|
2
|
-
import { useAuthQuery } from "./use-auth-query";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
options: {
|
|
14
|
-
queryKey: ["auth", "getSession"],
|
|
15
|
-
...options
|
|
16
|
-
}
|
|
17
|
-
});
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { useAuthQuery as t } from "./use-auth-query.js";
|
|
3
|
+
//#region src/hooks/auth/use-session.ts
|
|
4
|
+
function n(n) {
|
|
5
|
+
let { authClient: r } = e();
|
|
6
|
+
return t({
|
|
7
|
+
authFn: r.getSession,
|
|
8
|
+
options: {
|
|
9
|
+
queryKey: ["auth", "getSession"],
|
|
10
|
+
...n
|
|
11
|
+
}
|
|
12
|
+
});
|
|
18
13
|
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { n as useSession };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export { useAuthMutation } from "./use-auth-mutation";
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthMutationOptions } from './use-auth-mutation';
|
|
4
3
|
/**
|
|
5
4
|
* Hook that creates a mutation for email/password sign-in.
|
|
6
5
|
*
|
|
@@ -9,19 +8,19 @@ export { useAuthMutation } from "./use-auth-mutation";
|
|
|
9
8
|
*
|
|
10
9
|
* @returns The `useMutation` result.
|
|
11
10
|
*/
|
|
12
|
-
export declare function useSignInEmail(options?: UseAuthMutationOptions<AuthClient["signIn"]["email"]>): import(
|
|
11
|
+
export declare function useSignInEmail(options?: UseAuthMutationOptions<AuthClient["signIn"]["email"]>): import('./use-auth-mutation').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
|
|
13
12
|
email: string;
|
|
14
13
|
password: string;
|
|
15
14
|
callbackURL?: string | undefined;
|
|
16
15
|
rememberMe?: boolean | undefined;
|
|
17
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import(
|
|
16
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
|
|
18
17
|
email: string;
|
|
19
18
|
password: string;
|
|
20
19
|
callbackURL?: string | undefined;
|
|
21
20
|
rememberMe?: boolean | undefined;
|
|
22
21
|
} & {
|
|
23
22
|
fetchOptions?: FetchOptions | undefined;
|
|
24
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import(
|
|
23
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<Omit<{
|
|
25
24
|
redirect: boolean;
|
|
26
25
|
token: string;
|
|
27
26
|
url?: string | undefined;
|
|
@@ -35,7 +34,7 @@ export declare function useSignInEmail(options?: UseAuthMutationOptions<AuthClie
|
|
|
35
34
|
image?: string | null | undefined | undefined;
|
|
36
35
|
};
|
|
37
36
|
}, "user"> & {
|
|
38
|
-
user: import(
|
|
37
|
+
user: import('better-auth').StripEmptyObjects<{
|
|
39
38
|
id: string;
|
|
40
39
|
createdAt: Date;
|
|
41
40
|
updatedAt: Date;
|
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 { useAuthMutation as t } from "./use-auth-mutation.js";
|
|
3
|
+
import { useQueryClient as n } from "@tanstack/react-query";
|
|
4
|
+
//#region src/hooks/auth/use-sign-in-email.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { authClient: i } = e(), a = n();
|
|
7
|
+
return t({
|
|
8
|
+
authFn: i.signIn.email,
|
|
9
|
+
options: {
|
|
10
|
+
...r,
|
|
11
|
+
onSuccess: async (...e) => {
|
|
12
|
+
a.resetQueries({ queryKey: ["auth", "getSession"] }), await r?.onSuccess?.(...e);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
25
16
|
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as useSignInEmail };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export { useAuthMutation } from "./use-auth-mutation";
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthMutationOptions } from './use-auth-mutation';
|
|
4
3
|
/**
|
|
5
4
|
* Hook that creates a mutation for magic-link sign-in.
|
|
6
5
|
*
|
|
@@ -8,14 +7,14 @@ export { useAuthMutation } from "./use-auth-mutation";
|
|
|
8
7
|
*
|
|
9
8
|
* @returns The `useMutation` result.
|
|
10
9
|
*/
|
|
11
|
-
export declare function useSignInMagicLink(options?: UseAuthMutationOptions<AuthClient["signIn"]["magicLink"]>): import(
|
|
10
|
+
export declare function useSignInMagicLink(options?: UseAuthMutationOptions<AuthClient["signIn"]["magicLink"]>): import('./use-auth-mutation').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
|
|
12
11
|
email: string;
|
|
13
12
|
name?: string | undefined;
|
|
14
13
|
callbackURL?: string | undefined;
|
|
15
14
|
newUserCallbackURL?: string | undefined;
|
|
16
15
|
errorCallbackURL?: string | undefined;
|
|
17
16
|
metadata?: Record<string, any> | undefined;
|
|
18
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import(
|
|
17
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
|
|
19
18
|
email: string;
|
|
20
19
|
name?: string | undefined;
|
|
21
20
|
callbackURL?: string | undefined;
|
|
@@ -24,7 +23,7 @@ export declare function useSignInMagicLink(options?: UseAuthMutationOptions<Auth
|
|
|
24
23
|
metadata?: Record<string, any> | undefined;
|
|
25
24
|
} & {
|
|
26
25
|
fetchOptions?: FetchOptions | undefined;
|
|
27
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import(
|
|
26
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
|
|
28
27
|
status: boolean;
|
|
29
28
|
}, {
|
|
30
29
|
code?: string | undefined;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export function useSignInMagicLink(options) {
|
|
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 { useAuthMutation as t } from "./use-auth-mutation.js";
|
|
3
|
+
//#region src/hooks/auth/use-sign-in-magic-link.ts
|
|
4
|
+
function n(n) {
|
|
5
|
+
let { authClient: r } = e();
|
|
6
|
+
return t({
|
|
7
|
+
authFn: r.signIn.magicLink,
|
|
8
|
+
options: n
|
|
9
|
+
});
|
|
13
10
|
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as useSignInMagicLink };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthMutationOptions } from './use-auth-mutation';
|
|
3
3
|
/**
|
|
4
4
|
* Hook that creates a mutation for passkey sign-in.
|
|
5
5
|
*
|
|
@@ -8,12 +8,12 @@ import { type UseAuthMutationOptions } from "./use-auth-mutation";
|
|
|
8
8
|
*
|
|
9
9
|
* @returns The `useMutation` result.
|
|
10
10
|
*/
|
|
11
|
-
export declare function useSignInPasskey(options?: UseAuthMutationOptions<AuthClient["signIn"]["passkey"]>): import(
|
|
11
|
+
export declare function useSignInPasskey(options?: UseAuthMutationOptions<AuthClient["signIn"]["passkey"]>): import('./use-auth-mutation').UseAuthMutationResult<(opts?: {
|
|
12
12
|
autoFill?: boolean;
|
|
13
|
-
extensions?: import(
|
|
13
|
+
extensions?: import('@better-auth/passkey/client').AuthenticationExtensionsClientInputs;
|
|
14
14
|
returnWebAuthnResponse?: boolean;
|
|
15
|
-
fetchOptions?: import(
|
|
16
|
-
} | undefined, options?: import(
|
|
15
|
+
fetchOptions?: import('better-auth').ClientFetchOption;
|
|
16
|
+
} | undefined, options?: import('better-auth').ClientFetchOption | undefined) => Promise<{
|
|
17
17
|
data: null;
|
|
18
18
|
error: {
|
|
19
19
|
message?: string | undefined;
|
|
@@ -22,14 +22,14 @@ export declare function useSignInPasskey(options?: UseAuthMutationOptions<AuthCl
|
|
|
22
22
|
};
|
|
23
23
|
} | {
|
|
24
24
|
data: {
|
|
25
|
-
session: import(
|
|
26
|
-
user: import(
|
|
25
|
+
session: import('better-auth').Session;
|
|
26
|
+
user: import('better-auth').User;
|
|
27
27
|
};
|
|
28
28
|
error: null;
|
|
29
29
|
} | {
|
|
30
30
|
webauthn: {
|
|
31
|
-
response: import(
|
|
32
|
-
clientExtensionResults: import(
|
|
31
|
+
response: import('@better-auth/passkey/client').AuthenticationResponseJSON;
|
|
32
|
+
clientExtensionResults: import('@better-auth/passkey/client').AuthenticationExtensionsClientOutputs;
|
|
33
33
|
};
|
|
34
34
|
data: null;
|
|
35
35
|
error: {
|
|
@@ -39,12 +39,12 @@ export declare function useSignInPasskey(options?: UseAuthMutationOptions<AuthCl
|
|
|
39
39
|
};
|
|
40
40
|
} | {
|
|
41
41
|
webauthn: {
|
|
42
|
-
response: import(
|
|
43
|
-
clientExtensionResults: import(
|
|
42
|
+
response: import('@better-auth/passkey/client').AuthenticationResponseJSON;
|
|
43
|
+
clientExtensionResults: import('@better-auth/passkey/client').AuthenticationExtensionsClientOutputs;
|
|
44
44
|
};
|
|
45
45
|
data: {
|
|
46
|
-
session: import(
|
|
47
|
-
user: import(
|
|
46
|
+
session: import('better-auth').Session;
|
|
47
|
+
user: import('better-auth').User;
|
|
48
48
|
};
|
|
49
49
|
error: null;
|
|
50
50
|
} | {
|
|
@@ -1,25 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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 { useAuthMutation as t } from "./use-auth-mutation.js";
|
|
3
|
+
import { useQueryClient as n } from "@tanstack/react-query";
|
|
4
|
+
//#region src/hooks/auth/use-sign-in-passkey.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { authClient: i } = e(), a = n();
|
|
7
|
+
return t({
|
|
8
|
+
authFn: i.signIn.passkey,
|
|
9
|
+
options: {
|
|
10
|
+
...r,
|
|
11
|
+
onSuccess: async (...e) => {
|
|
12
|
+
a.resetQueries({ queryKey: ["auth", "getSession"] }), await r?.onSuccess?.(...e);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
25
16
|
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as useSignInPasskey };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export { useAuthMutation } from "./use-auth-mutation";
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthMutationOptions } from './use-auth-mutation';
|
|
4
3
|
/**
|
|
5
4
|
* Hook that creates a mutation for social sign-in.
|
|
6
5
|
*
|
|
@@ -8,8 +7,8 @@ export { useAuthMutation } from "./use-auth-mutation";
|
|
|
8
7
|
*
|
|
9
8
|
* @returns The `useMutation` result.
|
|
10
9
|
*/
|
|
11
|
-
export declare function useSignInSocial(options?: UseAuthMutationOptions<AuthClient["signIn"]["social"]>): import(
|
|
12
|
-
provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "
|
|
10
|
+
export declare function useSignInSocial(options?: UseAuthMutationOptions<AuthClient["signIn"]["social"]>): import('./use-auth-mutation').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
|
|
11
|
+
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
12
|
callbackURL?: string | undefined;
|
|
14
13
|
newUserCallbackURL?: string | undefined;
|
|
15
14
|
errorCallbackURL?: string | undefined;
|
|
@@ -32,8 +31,8 @@ export declare function useSignInSocial(options?: UseAuthMutationOptions<AuthCli
|
|
|
32
31
|
requestSignUp?: boolean | undefined;
|
|
33
32
|
loginHint?: string | undefined;
|
|
34
33
|
additionalData?: Record<string, any> | undefined;
|
|
35
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import(
|
|
36
|
-
provider: "github" | "apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "
|
|
34
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
|
|
35
|
+
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";
|
|
37
36
|
callbackURL?: string | undefined;
|
|
38
37
|
newUserCallbackURL?: string | undefined;
|
|
39
38
|
errorCallbackURL?: string | undefined;
|
|
@@ -58,7 +57,7 @@ export declare function useSignInSocial(options?: UseAuthMutationOptions<AuthCli
|
|
|
58
57
|
additionalData?: Record<string, any> | undefined;
|
|
59
58
|
} & {
|
|
60
59
|
fetchOptions?: FetchOptions | undefined;
|
|
61
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import(
|
|
60
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
|
|
62
61
|
redirect: boolean;
|
|
63
62
|
url: string;
|
|
64
63
|
} | (Omit<{
|
|
@@ -75,7 +74,7 @@ export declare function useSignInSocial(options?: UseAuthMutationOptions<AuthCli
|
|
|
75
74
|
image?: string | null | undefined | undefined;
|
|
76
75
|
};
|
|
77
76
|
}, "user"> & {
|
|
78
|
-
user: import(
|
|
77
|
+
user: import('better-auth').StripEmptyObjects<{
|
|
79
78
|
id: string;
|
|
80
79
|
createdAt: Date;
|
|
81
80
|
updatedAt: Date;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export function useSignInSocial(options) {
|
|
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 { useAuthMutation as t } from "./use-auth-mutation.js";
|
|
3
|
+
//#region src/hooks/auth/use-sign-in-social.ts
|
|
4
|
+
function n(n) {
|
|
5
|
+
let { authClient: r } = e();
|
|
6
|
+
return t({
|
|
7
|
+
authFn: r.signIn.social,
|
|
8
|
+
options: n
|
|
9
|
+
});
|
|
13
10
|
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as useSignInSocial };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthMutationOptions } from './use-auth-mutation';
|
|
3
|
+
/**
|
|
4
|
+
* Hook that creates a mutation for username/password sign-in.
|
|
5
|
+
*
|
|
6
|
+
* The mutation sends a username/password sign-in request and
|
|
7
|
+
* refetches the session on completion.
|
|
8
|
+
*
|
|
9
|
+
* @returns The `useMutation` result.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useSignInUsername(options?: UseAuthMutationOptions<AuthClient["signIn"]["username"]>): import('./use-auth-mutation').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
|
|
12
|
+
username: string;
|
|
13
|
+
password: string;
|
|
14
|
+
rememberMe?: boolean | undefined;
|
|
15
|
+
callbackURL?: string | undefined;
|
|
16
|
+
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
|
|
17
|
+
username: string;
|
|
18
|
+
password: string;
|
|
19
|
+
rememberMe?: boolean | undefined;
|
|
20
|
+
callbackURL?: string | undefined;
|
|
21
|
+
} & {
|
|
22
|
+
fetchOptions?: FetchOptions | undefined;
|
|
23
|
+
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<Omit<{
|
|
24
|
+
token: string;
|
|
25
|
+
user: {
|
|
26
|
+
id: string;
|
|
27
|
+
createdAt: Date;
|
|
28
|
+
updatedAt: Date;
|
|
29
|
+
email: string;
|
|
30
|
+
emailVerified: boolean;
|
|
31
|
+
name: string;
|
|
32
|
+
image?: string | null | undefined;
|
|
33
|
+
} & {
|
|
34
|
+
username: string;
|
|
35
|
+
displayUsername: string;
|
|
36
|
+
};
|
|
37
|
+
}, "user"> & {
|
|
38
|
+
user: import('better-auth').StripEmptyObjects<{
|
|
39
|
+
id: string;
|
|
40
|
+
createdAt: Date;
|
|
41
|
+
updatedAt: Date;
|
|
42
|
+
email: string;
|
|
43
|
+
emailVerified: boolean;
|
|
44
|
+
name: string;
|
|
45
|
+
image?: string | null | undefined;
|
|
46
|
+
} & {} & {
|
|
47
|
+
username?: string | null | undefined;
|
|
48
|
+
displayUsername?: string | null | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
}, {
|
|
51
|
+
code?: string | undefined;
|
|
52
|
+
message?: string | undefined;
|
|
53
|
+
}, FetchOptions["throw"] extends true ? true : false>>)>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useAuth as e } from "../../components/auth/auth-provider.js";
|
|
2
|
+
import { useAuthMutation as t } from "./use-auth-mutation.js";
|
|
3
|
+
import { useQueryClient as n } from "@tanstack/react-query";
|
|
4
|
+
//#region src/hooks/auth/use-sign-in-username.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { authClient: i } = e(), a = n();
|
|
7
|
+
return t({
|
|
8
|
+
authFn: i.signIn.username,
|
|
9
|
+
options: {
|
|
10
|
+
...r,
|
|
11
|
+
onSuccess: async (...e) => {
|
|
12
|
+
a.resetQueries({ queryKey: ["auth", "getSession"] }), await r?.onSuccess?.(...e);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as useSignInUsername };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
export { useAuthMutation } from "./use-auth-mutation";
|
|
1
|
+
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
+
import { UseAuthMutationOptions } from './use-auth-mutation';
|
|
4
3
|
/**
|
|
5
4
|
* Hook that creates a mutation for signing out.
|
|
6
5
|
*
|
|
@@ -8,10 +7,10 @@ export { useAuthMutation } from "./use-auth-mutation";
|
|
|
8
7
|
*
|
|
9
8
|
* @returns The `useMutation` result.
|
|
10
9
|
*/
|
|
11
|
-
export declare function useSignOut(options?: UseAuthMutationOptions<AuthClient["signOut"]>): import(
|
|
10
|
+
export declare function useSignOut(options?: UseAuthMutationOptions<AuthClient["signOut"]>): import('./use-auth-mutation').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<never, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0?: import('better-auth').Prettify<{
|
|
12
11
|
query?: Record<string, any> | undefined;
|
|
13
12
|
fetchOptions?: FetchOptions | undefined;
|
|
14
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import(
|
|
13
|
+
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
|
|
15
14
|
success: boolean;
|
|
16
15
|
}, {
|
|
17
16
|
code?: string | undefined;
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
import { useAuth
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
options: {
|
|
17
|
-
...options,
|
|
18
|
-
onSuccess: async (...args) => {
|
|
19
|
-
queryClient.removeQueries({ queryKey: ["auth"] });
|
|
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 "./use-auth-mutation.js";
|
|
3
|
+
import { useQueryClient as n } from "@tanstack/react-query";
|
|
4
|
+
//#region src/hooks/auth/use-sign-out.ts
|
|
5
|
+
function r(r) {
|
|
6
|
+
let { authClient: i } = e(), a = n();
|
|
7
|
+
return t({
|
|
8
|
+
authFn: i.signOut,
|
|
9
|
+
options: {
|
|
10
|
+
...r,
|
|
11
|
+
onSuccess: async (...e) => {
|
|
12
|
+
a.removeQueries({ queryKey: ["auth"] }), await r?.onSuccess?.(...e);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
});
|
|
24
16
|
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { r as useSignOut };
|