@better-auth-ui/react 1.6.2 → 1.6.4
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 +23 -8
- package/dist/components/auth/auth-provider.js +32 -17
- package/dist/components/{email → auth/email}/email-changed.js +2 -2
- package/dist/components/{email → auth/email}/email-localization.js +1 -1
- package/dist/components/{email → auth/email}/email-styles.js +1 -1
- package/dist/components/{email → auth/email}/email-verification.js +2 -2
- package/dist/components/{email → auth/email}/magic-link.js +2 -2
- package/dist/components/{email → auth/email}/new-device.js +2 -2
- package/dist/components/{email → auth/email}/otp-email.js +2 -2
- package/dist/components/{email → auth/email}/password-changed.js +2 -2
- package/dist/components/{email → auth/email}/reset-password.js +2 -2
- package/dist/email.d.ts +1 -0
- package/dist/email.js +11 -0
- package/dist/hooks/auth/use-authenticate.d.ts +6 -5
- package/dist/hooks/auth/use-authenticate.js +12 -12
- package/dist/hooks/auth/use-user.d.ts +18 -311
- package/dist/hooks/auth/use-user.js +5 -5
- package/dist/hooks/use-auth-mutation.d.ts +17 -0
- package/dist/hooks/use-auth-mutation.js +11 -0
- package/dist/hooks/use-auth-plugin.d.ts +31 -0
- package/dist/hooks/use-auth-plugin.js +10 -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 +35 -34
- package/dist/index.js +74 -83
- package/dist/lib/auth-client.d.ts +23 -3687
- package/dist/lib/auth-plugin.d.ts +59 -0
- package/dist/lib/auth-server.d.ts +16 -0
- package/dist/mutations/auth/request-password-reset-mutation.d.ts +26 -0
- package/dist/mutations/auth/request-password-reset-mutation.js +24 -0
- package/dist/mutations/auth/reset-password-mutation.d.ts +25 -0
- package/dist/mutations/auth/reset-password-mutation.js +24 -0
- package/dist/mutations/auth/send-verification-email-mutation.d.ts +24 -0
- package/dist/mutations/auth/send-verification-email-mutation.js +24 -0
- package/dist/mutations/auth/sign-in-email-mutation.d.ts +71 -0
- package/dist/mutations/auth/sign-in-email-mutation.js +29 -0
- package/dist/mutations/auth/sign-in-social-mutation.d.ts +77 -0
- package/dist/mutations/auth/sign-in-social-mutation.js +24 -0
- package/dist/mutations/auth/sign-out-mutation.d.ts +25 -0
- package/dist/mutations/auth/sign-out-mutation.js +28 -0
- package/dist/mutations/auth/sign-up-email-mutation.d.ts +105 -0
- package/dist/mutations/auth/sign-up-email-mutation.js +29 -0
- package/dist/mutations/auth-mutation-options.d.ts +42 -0
- package/dist/mutations/auth-mutation-options.js +19 -0
- package/dist/mutations/magic-link/sign-in-magic-link-mutation.d.ts +24 -0
- package/dist/mutations/magic-link/sign-in-magic-link-mutation.js +24 -0
- package/dist/mutations/multi-session/revoke-multi-session-mutation.d.ts +25 -0
- package/dist/mutations/multi-session/revoke-multi-session-mutation.js +29 -0
- package/dist/mutations/multi-session/set-active-session-mutation.d.ts +62 -0
- package/dist/mutations/multi-session/set-active-session-mutation.js +31 -0
- package/dist/mutations/passkey/add-passkey-mutation.d.ts +71 -0
- package/dist/mutations/passkey/add-passkey-mutation.js +29 -0
- package/dist/mutations/passkey/delete-passkey-mutation.d.ts +25 -0
- package/dist/mutations/passkey/delete-passkey-mutation.js +29 -0
- package/dist/mutations/passkey/sign-in-passkey-mutation.d.ts +105 -0
- package/dist/mutations/passkey/sign-in-passkey-mutation.js +29 -0
- package/dist/mutations/settings/change-email-mutation.d.ts +25 -0
- package/dist/mutations/settings/change-email-mutation.js +29 -0
- package/dist/mutations/settings/change-password-mutation.d.ts +78 -0
- package/dist/mutations/settings/change-password-mutation.js +24 -0
- package/dist/mutations/settings/delete-user-mutation.d.ts +26 -0
- package/dist/mutations/settings/delete-user-mutation.js +24 -0
- package/dist/mutations/settings/link-social-mutation.d.ts +26 -0
- package/dist/mutations/settings/link-social-mutation.js +24 -0
- package/dist/mutations/settings/revoke-session-mutation.d.ts +25 -0
- package/dist/mutations/settings/revoke-session-mutation.js +29 -0
- package/dist/mutations/settings/unlink-account-mutation.d.ts +25 -0
- package/dist/mutations/settings/unlink-account-mutation.js +29 -0
- package/dist/mutations/settings/update-user-mutation.d.ts +25 -0
- package/dist/mutations/settings/update-user-mutation.js +35 -0
- package/dist/mutations/username/is-username-available-mutation.d.ts +27 -0
- package/dist/mutations/username/is-username-available-mutation.js +24 -0
- package/dist/mutations/username/sign-in-username-mutation.d.ts +75 -0
- package/dist/mutations/username/sign-in-username-mutation.js +29 -0
- package/dist/queries/auth/session-query.d.ts +71 -0
- package/dist/queries/auth/session-query.js +30 -0
- package/dist/queries/auth-query-options.d.ts +40 -0
- package/dist/queries/auth-query-options.js +17 -0
- package/dist/queries/multi-session/list-device-sessions-query.d.ts +76 -0
- package/dist/queries/multi-session/list-device-sessions-query.js +31 -0
- package/dist/queries/passkey/list-passkeys-query.d.ts +74 -0
- package/dist/queries/passkey/list-passkeys-query.js +31 -0
- package/dist/queries/settings/account-info-query.d.ts +85 -0
- package/dist/queries/settings/account-info-query.js +31 -0
- package/dist/queries/settings/list-accounts-query.d.ts +76 -0
- package/dist/queries/settings/list-accounts-query.js +31 -0
- package/dist/queries/settings/list-sessions-query.d.ts +74 -0
- package/dist/queries/settings/list-sessions-query.js +31 -0
- package/dist/server/queries/auth/session-query.d.ts +57 -0
- package/dist/server/queries/auth/session-query.js +13 -0
- package/dist/server/queries/multi-session/list-device-sessions-query.d.ts +60 -0
- package/dist/server/queries/multi-session/list-device-sessions-query.js +12 -0
- package/dist/server/queries/passkey/list-passkeys-query.d.ts +60 -0
- package/dist/server/queries/passkey/list-passkeys-query.js +12 -0
- package/dist/server/queries/settings/account-info-query.d.ts +68 -0
- package/dist/server/queries/settings/account-info-query.js +12 -0
- package/dist/server/queries/settings/list-accounts-query.d.ts +60 -0
- package/dist/server/queries/settings/list-accounts-query.js +12 -0
- package/dist/server/queries/settings/list-sessions-query.d.ts +60 -0
- package/dist/server/queries/settings/list-sessions-query.js +12 -0
- package/dist/server.d.ts +7 -0
- package/dist/server.js +7 -0
- package/package.json +24 -22
- package/src/components/auth/auth-provider.tsx +87 -24
- package/src/components/{email → auth/email}/email-changed.tsx +1 -1
- package/src/components/{email → auth/email}/email-verification.tsx +1 -1
- package/src/components/{email → auth/email}/magic-link.tsx +1 -1
- package/src/components/{email → auth/email}/new-device.tsx +1 -1
- package/src/components/{email → auth/email}/otp-email.tsx +1 -1
- package/src/components/{email → auth/email}/password-changed.tsx +1 -1
- package/src/components/{email → auth/email}/reset-password.tsx +1 -1
- package/src/email.ts +1 -0
- package/src/hooks/auth/use-authenticate.ts +13 -10
- package/src/hooks/auth/use-user.ts +12 -8
- package/src/hooks/use-auth-mutation.ts +47 -0
- package/src/hooks/use-auth-plugin.ts +50 -0
- package/src/hooks/use-auth-query.ts +40 -0
- package/src/index.ts +35 -34
- package/src/lib/auth-client.ts +33 -31
- package/src/lib/auth-plugin.ts +75 -0
- package/src/lib/auth-server.ts +30 -0
- package/src/mutations/auth/request-password-reset-mutation.ts +58 -0
- package/src/mutations/auth/reset-password-mutation.ts +60 -0
- package/src/mutations/auth/send-verification-email-mutation.ts +58 -0
- package/src/mutations/auth/sign-in-email-mutation.ts +78 -0
- package/src/mutations/auth/sign-in-social-mutation.ts +64 -0
- package/src/mutations/auth/sign-out-mutation.ts +71 -0
- package/src/mutations/auth/sign-up-email-mutation.ts +74 -0
- package/src/mutations/auth-mutation-options.ts +94 -0
- package/src/mutations/magic-link/sign-in-magic-link-mutation.ts +59 -0
- package/src/mutations/multi-session/revoke-multi-session-mutation.ts +70 -0
- package/src/mutations/multi-session/set-active-session-mutation.ts +98 -0
- package/src/mutations/passkey/add-passkey-mutation.ts +66 -0
- package/src/mutations/passkey/delete-passkey-mutation.ts +66 -0
- package/src/mutations/passkey/sign-in-passkey-mutation.ts +74 -0
- package/src/mutations/settings/change-email-mutation.ts +67 -0
- package/src/mutations/settings/change-password-mutation.ts +59 -0
- package/src/mutations/settings/delete-user-mutation.ts +59 -0
- package/src/mutations/settings/link-social-mutation.ts +59 -0
- package/src/mutations/settings/revoke-session-mutation.ts +69 -0
- package/src/mutations/settings/unlink-account-mutation.ts +67 -0
- package/src/mutations/settings/update-user-mutation.ts +82 -0
- package/src/mutations/username/is-username-available-mutation.ts +62 -0
- package/src/mutations/username/sign-in-username-mutation.ts +74 -0
- package/src/queries/auth/session-query.ts +135 -0
- package/src/queries/auth-query-options.ts +83 -0
- package/src/queries/multi-session/list-device-sessions-query.ts +177 -0
- package/src/queries/passkey/list-passkeys-query.ts +154 -0
- package/src/queries/settings/account-info-query.ts +158 -0
- package/src/queries/settings/list-accounts-query.ts +156 -0
- package/src/queries/settings/list-sessions-query.ts +154 -0
- package/src/server/queries/auth/session-query.ts +94 -0
- package/src/server/queries/multi-session/list-device-sessions-query.ts +102 -0
- package/src/server/queries/passkey/list-passkeys-query.ts +100 -0
- package/src/server/queries/settings/account-info-query.ts +101 -0
- package/src/server/queries/settings/list-accounts-query.ts +101 -0
- package/src/server/queries/settings/list-sessions-query.ts +101 -0
- package/src/server.ts +7 -0
- package/dist/core.d.ts +0 -1
- package/dist/core.js +0 -1
- package/dist/hooks/auth/use-auth-mutation.d.ts +0 -18
- package/dist/hooks/auth/use-auth-mutation.js +0 -13
- package/dist/hooks/auth/use-auth-query.d.ts +0 -24
- package/dist/hooks/auth/use-auth-query.js +0 -13
- package/dist/hooks/auth/use-is-username-available.d.ts +0 -19
- package/dist/hooks/auth/use-is-username-available.js +0 -12
- package/dist/hooks/auth/use-request-password-reset.d.ts +0 -25
- package/dist/hooks/auth/use-request-password-reset.js +0 -12
- package/dist/hooks/auth/use-reset-password.d.ts +0 -39
- package/dist/hooks/auth/use-reset-password.js +0 -12
- package/dist/hooks/auth/use-send-verification-email.d.ts +0 -23
- package/dist/hooks/auth/use-send-verification-email.js +0 -12
- package/dist/hooks/auth/use-session.d.ts +0 -9
- package/dist/hooks/auth/use-session.js +0 -15
- package/dist/hooks/auth/use-sign-in-email.d.ts +0 -52
- package/dist/hooks/auth/use-sign-in-email.js +0 -18
- package/dist/hooks/auth/use-sign-in-magic-link.d.ts +0 -31
- package/dist/hooks/auth/use-sign-in-magic-link.js +0 -12
- package/dist/hooks/auth/use-sign-in-passkey.d.ts +0 -58
- package/dist/hooks/auth/use-sign-in-passkey.js +0 -18
- package/dist/hooks/auth/use-sign-in-social.d.ts +0 -92
- package/dist/hooks/auth/use-sign-in-social.js +0 -12
- package/dist/hooks/auth/use-sign-in-username.d.ts +0 -53
- package/dist/hooks/auth/use-sign-in-username.js +0 -18
- package/dist/hooks/auth/use-sign-out.d.ts +0 -18
- package/dist/hooks/auth/use-sign-out.js +0 -18
- package/dist/hooks/auth/use-sign-up-email.d.ts +0 -1269
- package/dist/hooks/auth/use-sign-up-email.js +0 -18
- package/dist/hooks/settings/use-account-info.d.ts +0 -17
- package/dist/hooks/settings/use-account-info.js +0 -21
- package/dist/hooks/settings/use-add-passkey.d.ts +0 -43
- package/dist/hooks/settings/use-add-passkey.js +0 -18
- package/dist/hooks/settings/use-change-email.d.ts +0 -24
- package/dist/hooks/settings/use-change-email.js +0 -18
- package/dist/hooks/settings/use-change-password.d.ts +0 -53
- package/dist/hooks/settings/use-change-password.js +0 -12
- package/dist/hooks/settings/use-delete-passkey.d.ts +0 -21
- package/dist/hooks/settings/use-delete-passkey.js +0 -18
- package/dist/hooks/settings/use-delete-user.d.ts +0 -41
- package/dist/hooks/settings/use-delete-user.js +0 -12
- package/dist/hooks/settings/use-link-social.d.ts +0 -46
- package/dist/hooks/settings/use-link-social.js +0 -12
- package/dist/hooks/settings/use-list-accounts.d.ts +0 -20
- package/dist/hooks/settings/use-list-accounts.js +0 -21
- package/dist/hooks/settings/use-list-device-sessions.d.ts +0 -11
- package/dist/hooks/settings/use-list-device-sessions.js +0 -21
- package/dist/hooks/settings/use-list-sessions.d.ts +0 -20
- package/dist/hooks/settings/use-list-sessions.js +0 -21
- package/dist/hooks/settings/use-list-user-passkeys.d.ts +0 -11
- package/dist/hooks/settings/use-list-user-passkeys.js +0 -21
- package/dist/hooks/settings/use-revoke-multi-session.d.ts +0 -19
- package/dist/hooks/settings/use-revoke-multi-session.js +0 -18
- package/dist/hooks/settings/use-revoke-session.d.ts +0 -19
- package/dist/hooks/settings/use-revoke-session.js +0 -18
- package/dist/hooks/settings/use-set-active-session.d.ts +0 -37
- package/dist/hooks/settings/use-set-active-session.js +0 -21
- package/dist/hooks/settings/use-unlink-account.d.ts +0 -21
- package/dist/hooks/settings/use-unlink-account.js +0 -18
- package/dist/hooks/settings/use-update-user.d.ts +0 -11
- package/dist/hooks/settings/use-update-user.js +0 -25
- package/dist/lib/auth-client.js +0 -11
- package/dist/lib/auth-config.d.ts +0 -43
- package/dist/lib/auth-context.d.ts +0 -2
- package/dist/lib/auth-context.js +0 -6
- package/src/core.ts +0 -1
- package/src/hooks/auth/use-auth-mutation.ts +0 -56
- package/src/hooks/auth/use-auth-query.ts +0 -50
- package/src/hooks/auth/use-is-username-available.ts +0 -22
- package/src/hooks/auth/use-request-password-reset.ts +0 -22
- package/src/hooks/auth/use-reset-password.ts +0 -21
- package/src/hooks/auth/use-send-verification-email.ts +0 -21
- package/src/hooks/auth/use-session.ts +0 -27
- package/src/hooks/auth/use-sign-in-email.ts +0 -34
- package/src/hooks/auth/use-sign-in-magic-link.ts +0 -21
- package/src/hooks/auth/use-sign-in-passkey.ts +0 -34
- package/src/hooks/auth/use-sign-in-social.ts +0 -21
- package/src/hooks/auth/use-sign-in-username.ts +0 -34
- package/src/hooks/auth/use-sign-out.ts +0 -33
- package/src/hooks/auth/use-sign-up-email.ts +0 -34
- package/src/hooks/settings/use-account-info.ts +0 -31
- package/src/hooks/settings/use-add-passkey.ts +0 -32
- package/src/hooks/settings/use-change-email.ts +0 -33
- package/src/hooks/settings/use-change-password.ts +0 -19
- package/src/hooks/settings/use-delete-passkey.ts +0 -32
- package/src/hooks/settings/use-delete-user.ts +0 -19
- package/src/hooks/settings/use-link-social.ts +0 -19
- package/src/hooks/settings/use-list-accounts.ts +0 -29
- package/src/hooks/settings/use-list-device-sessions.ts +0 -34
- package/src/hooks/settings/use-list-sessions.ts +0 -28
- package/src/hooks/settings/use-list-user-passkeys.ts +0 -30
- package/src/hooks/settings/use-revoke-multi-session.ts +0 -30
- package/src/hooks/settings/use-revoke-session.ts +0 -30
- package/src/hooks/settings/use-set-active-session.ts +0 -47
- package/src/hooks/settings/use-unlink-account.ts +0 -30
- package/src/hooks/settings/use-update-user.ts +0 -43
- package/src/lib/auth-config.ts +0 -48
- package/src/lib/auth-context.ts +0 -6
- /package/dist/components/{email → auth/email}/email-changed.d.ts +0 -0
- /package/dist/components/{email → auth/email}/email-localization.d.ts +0 -0
- /package/dist/components/{email → auth/email}/email-styles.d.ts +0 -0
- /package/dist/components/{email → auth/email}/email-verification.d.ts +0 -0
- /package/dist/components/{email → auth/email}/index.d.ts +0 -0
- /package/dist/components/{email → auth/email}/index.js +0 -0
- /package/dist/components/{email → auth/email}/magic-link.d.ts +0 -0
- /package/dist/components/{email → auth/email}/new-device.d.ts +0 -0
- /package/dist/components/{email → auth/email}/otp-email.d.ts +0 -0
- /package/dist/components/{email → auth/email}/password-changed.d.ts +0 -0
- /package/dist/components/{email → auth/email}/reset-password.d.ts +0 -0
- /package/src/components/{email → auth/email}/email-localization.tsx +0 -0
- /package/src/components/{email → auth/email}/email-styles.tsx +0 -0
- /package/src/components/{email → auth/email}/index.ts +0 -0
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
});
|
|
13
|
-
}
|
|
14
|
-
//#endregion
|
|
15
|
-
export { n as useSession };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { UseAuthMutationOptions } from './use-auth-mutation';
|
|
3
|
-
/**
|
|
4
|
-
* Hook that creates a mutation for email/password sign-in.
|
|
5
|
-
*
|
|
6
|
-
* The mutation sends an email/password sign-in request and
|
|
7
|
-
* refetches the session on completion.
|
|
8
|
-
*
|
|
9
|
-
* @returns The `useMutation` result.
|
|
10
|
-
*/
|
|
11
|
-
export declare function useSignInEmail(options?: UseAuthMutationOptions<AuthClient["signIn"]["email"]>): import('./use-auth-mutation').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
|
|
12
|
-
email: string;
|
|
13
|
-
password: string;
|
|
14
|
-
callbackURL?: string | undefined;
|
|
15
|
-
rememberMe?: boolean | undefined;
|
|
16
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
|
|
17
|
-
email: string;
|
|
18
|
-
password: string;
|
|
19
|
-
callbackURL?: string | undefined;
|
|
20
|
-
rememberMe?: boolean | undefined;
|
|
21
|
-
} & {
|
|
22
|
-
fetchOptions?: FetchOptions | undefined;
|
|
23
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<Omit<{
|
|
24
|
-
redirect: boolean;
|
|
25
|
-
token: string;
|
|
26
|
-
url?: string | undefined;
|
|
27
|
-
user: {
|
|
28
|
-
id: string;
|
|
29
|
-
createdAt: Date;
|
|
30
|
-
updatedAt: Date;
|
|
31
|
-
email: string;
|
|
32
|
-
emailVerified: boolean;
|
|
33
|
-
name: string;
|
|
34
|
-
image?: string | null | undefined | undefined;
|
|
35
|
-
};
|
|
36
|
-
}, "user"> & {
|
|
37
|
-
user: import('better-auth').StripEmptyObjects<{
|
|
38
|
-
id: string;
|
|
39
|
-
createdAt: Date;
|
|
40
|
-
updatedAt: Date;
|
|
41
|
-
email: string;
|
|
42
|
-
emailVerified: boolean;
|
|
43
|
-
name: string;
|
|
44
|
-
image?: string | null | undefined;
|
|
45
|
-
} & {} & {
|
|
46
|
-
username?: string | null | undefined;
|
|
47
|
-
displayUsername?: string | null | undefined;
|
|
48
|
-
}>;
|
|
49
|
-
}, {
|
|
50
|
-
code?: string | undefined;
|
|
51
|
-
message?: string | undefined;
|
|
52
|
-
}, FetchOptions["throw"] extends true ? true : false>>)>;
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
});
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
export { r as useSignInEmail };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { UseAuthMutationOptions } from './use-auth-mutation';
|
|
3
|
-
/**
|
|
4
|
-
* Hook that creates a mutation for magic-link sign-in.
|
|
5
|
-
*
|
|
6
|
-
* The mutation sends a magic-link sign-in email to the specified address.
|
|
7
|
-
*
|
|
8
|
-
* @returns The `useMutation` result.
|
|
9
|
-
*/
|
|
10
|
-
export declare function useSignInMagicLink(options?: UseAuthMutationOptions<AuthClient["signIn"]["magicLink"]>): import('./use-auth-mutation').UseAuthMutationResult<(<FetchOptions extends import('better-auth').ClientFetchOption<Partial<{
|
|
11
|
-
email: string;
|
|
12
|
-
name?: string | undefined;
|
|
13
|
-
callbackURL?: string | undefined;
|
|
14
|
-
newUserCallbackURL?: string | undefined;
|
|
15
|
-
errorCallbackURL?: string | undefined;
|
|
16
|
-
metadata?: Record<string, any> | undefined;
|
|
17
|
-
}> & Record<string, any>, Partial<Record<string, any>> & Record<string, any>, Record<string, any> | undefined>>(data_0: import('better-auth').Prettify<{
|
|
18
|
-
email: string;
|
|
19
|
-
name?: string | undefined;
|
|
20
|
-
callbackURL?: string | undefined;
|
|
21
|
-
newUserCallbackURL?: string | undefined;
|
|
22
|
-
errorCallbackURL?: string | undefined;
|
|
23
|
-
metadata?: Record<string, any> | undefined;
|
|
24
|
-
} & {
|
|
25
|
-
fetchOptions?: FetchOptions | undefined;
|
|
26
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
|
|
27
|
-
status: boolean;
|
|
28
|
-
}, {
|
|
29
|
-
code?: string | undefined;
|
|
30
|
-
message?: string | undefined;
|
|
31
|
-
}, FetchOptions["throw"] extends true ? true : false>>)>;
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
});
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
12
|
-
export { n as useSignInMagicLink };
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { UseAuthMutationOptions } from './use-auth-mutation';
|
|
3
|
-
/**
|
|
4
|
-
* Hook that creates a mutation for passkey sign-in.
|
|
5
|
-
*
|
|
6
|
-
* The mutation sends a passkey sign-in request and
|
|
7
|
-
* refetches the session on completion.
|
|
8
|
-
*
|
|
9
|
-
* @returns The `useMutation` result.
|
|
10
|
-
*/
|
|
11
|
-
export declare function useSignInPasskey(options?: UseAuthMutationOptions<AuthClient["signIn"]["passkey"]>): import('./use-auth-mutation').UseAuthMutationResult<(opts?: {
|
|
12
|
-
autoFill?: boolean;
|
|
13
|
-
extensions?: import('@better-auth/passkey/client').AuthenticationExtensionsClientInputs;
|
|
14
|
-
returnWebAuthnResponse?: boolean;
|
|
15
|
-
fetchOptions?: import('better-auth').ClientFetchOption;
|
|
16
|
-
} | undefined, options?: import('better-auth').ClientFetchOption | undefined) => Promise<{
|
|
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
|
-
}>>;
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
});
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
export { r as useSignInPasskey };
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { UseAuthMutationOptions } from './use-auth-mutation';
|
|
3
|
-
/**
|
|
4
|
-
* Hook that creates a mutation for social sign-in.
|
|
5
|
-
*
|
|
6
|
-
* The mutation initiates a social sign-in flow with the specified provider.
|
|
7
|
-
*
|
|
8
|
-
* @returns The `useMutation` result.
|
|
9
|
-
*/
|
|
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";
|
|
12
|
-
callbackURL?: string | undefined;
|
|
13
|
-
newUserCallbackURL?: string | undefined;
|
|
14
|
-
errorCallbackURL?: string | undefined;
|
|
15
|
-
disableRedirect?: boolean | undefined;
|
|
16
|
-
idToken?: {
|
|
17
|
-
token: string;
|
|
18
|
-
nonce?: string | undefined;
|
|
19
|
-
accessToken?: string | undefined;
|
|
20
|
-
refreshToken?: string | undefined;
|
|
21
|
-
expiresAt?: number | undefined;
|
|
22
|
-
user?: {
|
|
23
|
-
name?: {
|
|
24
|
-
firstName?: string | undefined;
|
|
25
|
-
lastName?: string | undefined;
|
|
26
|
-
} | undefined;
|
|
27
|
-
email?: string | undefined;
|
|
28
|
-
} | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
scopes?: string[] | undefined;
|
|
31
|
-
requestSignUp?: boolean | undefined;
|
|
32
|
-
loginHint?: string | undefined;
|
|
33
|
-
additionalData?: Record<string, any> | undefined;
|
|
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";
|
|
36
|
-
callbackURL?: string | undefined;
|
|
37
|
-
newUserCallbackURL?: string | undefined;
|
|
38
|
-
errorCallbackURL?: string | undefined;
|
|
39
|
-
disableRedirect?: boolean | undefined;
|
|
40
|
-
idToken?: {
|
|
41
|
-
token: string;
|
|
42
|
-
nonce?: string | undefined;
|
|
43
|
-
accessToken?: string | undefined;
|
|
44
|
-
refreshToken?: string | undefined;
|
|
45
|
-
expiresAt?: number | undefined;
|
|
46
|
-
user?: {
|
|
47
|
-
name?: {
|
|
48
|
-
firstName?: string | undefined;
|
|
49
|
-
lastName?: string | undefined;
|
|
50
|
-
} | undefined;
|
|
51
|
-
email?: string | undefined;
|
|
52
|
-
} | undefined;
|
|
53
|
-
} | undefined;
|
|
54
|
-
scopes?: string[] | undefined;
|
|
55
|
-
requestSignUp?: boolean | undefined;
|
|
56
|
-
loginHint?: string | undefined;
|
|
57
|
-
additionalData?: Record<string, any> | undefined;
|
|
58
|
-
} & {
|
|
59
|
-
fetchOptions?: FetchOptions | undefined;
|
|
60
|
-
}>, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
|
|
61
|
-
redirect: boolean;
|
|
62
|
-
url: string;
|
|
63
|
-
} | (Omit<{
|
|
64
|
-
redirect: boolean;
|
|
65
|
-
token: string;
|
|
66
|
-
url: undefined;
|
|
67
|
-
user: {
|
|
68
|
-
id: string;
|
|
69
|
-
createdAt: Date;
|
|
70
|
-
updatedAt: Date;
|
|
71
|
-
email: string;
|
|
72
|
-
emailVerified: boolean;
|
|
73
|
-
name: string;
|
|
74
|
-
image?: string | null | undefined | undefined;
|
|
75
|
-
};
|
|
76
|
-
}, "user"> & {
|
|
77
|
-
user: import('better-auth').StripEmptyObjects<{
|
|
78
|
-
id: string;
|
|
79
|
-
createdAt: Date;
|
|
80
|
-
updatedAt: Date;
|
|
81
|
-
email: string;
|
|
82
|
-
emailVerified: boolean;
|
|
83
|
-
name: string;
|
|
84
|
-
image?: string | null | undefined;
|
|
85
|
-
} & {} & {
|
|
86
|
-
username?: string | null | undefined;
|
|
87
|
-
displayUsername?: string | null | undefined;
|
|
88
|
-
}>;
|
|
89
|
-
}), {
|
|
90
|
-
code?: string | undefined;
|
|
91
|
-
message?: string | undefined;
|
|
92
|
-
}, FetchOptions["throw"] extends true ? true : false>>)>;
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
});
|
|
10
|
-
}
|
|
11
|
-
//#endregion
|
|
12
|
-
export { n as useSignInSocial };
|
|
@@ -1,53 +0,0 @@
|
|
|
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>>)>;
|
|
@@ -1,18 +0,0 @@
|
|
|
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,18 +0,0 @@
|
|
|
1
|
-
import { AuthClient } from '../../lib/auth-client';
|
|
2
|
-
import { UseAuthMutationOptions } from './use-auth-mutation';
|
|
3
|
-
/**
|
|
4
|
-
* Hook that creates a mutation for signing out.
|
|
5
|
-
*
|
|
6
|
-
* The mutation signs out the current user and removes auth queries from cache.
|
|
7
|
-
*
|
|
8
|
-
* @returns The `useMutation` result.
|
|
9
|
-
*/
|
|
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<{
|
|
11
|
-
query?: Record<string, any> | undefined;
|
|
12
|
-
fetchOptions?: FetchOptions | undefined;
|
|
13
|
-
}> | undefined, data_1?: FetchOptions | undefined) => Promise<import('better-auth/client').BetterFetchResponse<{
|
|
14
|
-
success: boolean;
|
|
15
|
-
}, {
|
|
16
|
-
code?: string | undefined;
|
|
17
|
-
message?: string | undefined;
|
|
18
|
-
}, FetchOptions["throw"] extends true ? true : false>>)>;
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
});
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
export { r as useSignOut };
|