@better-auth-ui/react 1.6.9 → 1.6.10
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-context.d.ts +2 -2
- package/dist/components/auth/auth-provider.d.ts +4 -4
- package/dist/components/auth/email/email-changed.d.ts +2 -2
- package/dist/components/auth/email/email-verification.d.ts +2 -2
- package/dist/components/auth/email/index.d.ts +10 -10
- package/dist/components/auth/email/magic-link.d.ts +2 -2
- package/dist/components/auth/email/new-device.d.ts +2 -2
- package/dist/components/auth/email/organization-invitation.d.ts +2 -2
- package/dist/components/auth/email/otp-email.d.ts +2 -2
- package/dist/components/auth/email/password-changed.d.ts +2 -2
- package/dist/components/auth/email/reset-password.d.ts +2 -2
- package/dist/components/auth/fetch-options-provider.d.ts +1 -1
- package/dist/components/icons/apple.d.ts +1 -1
- package/dist/components/icons/atlassian.d.ts +1 -1
- package/dist/components/icons/cognito.d.ts +1 -1
- package/dist/components/icons/discord.d.ts +1 -1
- package/dist/components/icons/dropbox.d.ts +1 -1
- package/dist/components/icons/facebook.d.ts +1 -1
- package/dist/components/icons/figma.d.ts +1 -1
- package/dist/components/icons/github.d.ts +1 -1
- package/dist/components/icons/gitlab.d.ts +1 -1
- package/dist/components/icons/google.d.ts +1 -1
- package/dist/components/icons/huggingface.d.ts +1 -1
- package/dist/components/icons/index.d.ts +35 -35
- package/dist/components/icons/kakao.d.ts +1 -1
- package/dist/components/icons/kick.d.ts +1 -1
- package/dist/components/icons/line.d.ts +1 -1
- package/dist/components/icons/linear.d.ts +1 -1
- package/dist/components/icons/linkedin.d.ts +1 -1
- package/dist/components/icons/microsoft.d.ts +1 -1
- package/dist/components/icons/naver.d.ts +1 -1
- package/dist/components/icons/notion.d.ts +1 -1
- package/dist/components/icons/paybin.d.ts +1 -1
- package/dist/components/icons/paypal.d.ts +1 -1
- package/dist/components/icons/polar.d.ts +1 -1
- package/dist/components/icons/railway.d.ts +1 -1
- package/dist/components/icons/reddit.d.ts +1 -1
- package/dist/components/icons/roblox.d.ts +1 -1
- package/dist/components/icons/salesforce.d.ts +1 -1
- package/dist/components/icons/slack.d.ts +1 -1
- package/dist/components/icons/spotify.d.ts +1 -1
- package/dist/components/icons/tiktok.d.ts +1 -1
- package/dist/components/icons/twitch.d.ts +1 -1
- package/dist/components/icons/vercel.d.ts +1 -1
- package/dist/components/icons/vk.d.ts +1 -1
- package/dist/components/icons/wechat.d.ts +1 -1
- package/dist/components/icons/x.d.ts +1 -1
- package/dist/components/icons/zoom.d.ts +1 -1
- package/dist/email.d.ts +1 -1
- package/dist/email.js +1348 -1
- package/dist/hooks/auth/use-authenticate.d.ts +3 -3
- package/dist/hooks/auth/use-user.d.ts +34 -34
- package/dist/hooks/use-auth-mutation.d.ts +4 -4
- package/dist/hooks/use-auth-plugin.d.ts +1 -1
- package/dist/hooks/use-auth-query.d.ts +3 -3
- package/dist/index.d.ts +48 -48
- package/dist/index.js +2469 -47
- package/dist/lib/auth-client.d.ts +4 -4
- package/dist/lib/auth-plugin.d.ts +4 -4
- package/dist/lib/auth-server.d.ts +4 -4
- package/dist/lib/provider-icons.d.ts +2 -2
- package/dist/lib/settings-tab.d.ts +2 -2
- package/dist/lib/utils.d.ts +1 -1
- package/dist/mutations/api-key/create-api-key-mutation.d.ts +5 -5
- package/dist/mutations/api-key/delete-api-key-mutation.d.ts +5 -5
- package/dist/mutations/auth/request-password-reset-mutation.d.ts +4 -4
- package/dist/mutations/auth/reset-password-mutation.d.ts +4 -4
- package/dist/mutations/auth/send-verification-email-mutation.d.ts +4 -4
- package/dist/mutations/auth/sign-in-email-mutation.d.ts +7 -7
- package/dist/mutations/auth/sign-in-social-mutation.d.ts +6 -6
- package/dist/mutations/auth/sign-out-mutation.d.ts +5 -5
- package/dist/mutations/auth/sign-up-email-mutation.d.ts +9 -9
- package/dist/mutations/auth-mutation-options.d.ts +2 -2
- package/dist/mutations/magic-link/sign-in-magic-link-mutation.d.ts +4 -4
- package/dist/mutations/multi-session/revoke-multi-session-mutation.d.ts +5 -5
- package/dist/mutations/multi-session/set-active-session-mutation.d.ts +5 -5
- package/dist/mutations/organization/accept-invitation-mutation.d.ts +7 -7
- package/dist/mutations/organization/cancel-invitation-mutation.d.ts +7 -7
- package/dist/mutations/organization/check-slug-mutation.d.ts +4 -4
- package/dist/mutations/organization/create-organization-mutation.d.ts +5 -5
- package/dist/mutations/organization/delete-organization-mutation.d.ts +5 -5
- package/dist/mutations/organization/index.d.ts +12 -12
- package/dist/mutations/organization/invite-member-mutation.d.ts +9 -9
- package/dist/mutations/organization/leave-organization-mutation.d.ts +5 -5
- package/dist/mutations/organization/reject-invitation-mutation.d.ts +7 -7
- package/dist/mutations/organization/remove-member-mutation.d.ts +5 -5
- package/dist/mutations/organization/set-active-organization-mutation.d.ts +7 -7
- package/dist/mutations/organization/update-member-role-mutation.d.ts +5 -5
- package/dist/mutations/organization/update-organization-mutation.d.ts +5 -5
- package/dist/mutations/passkey/add-passkey-mutation.d.ts +13 -13
- package/dist/mutations/passkey/delete-passkey-mutation.d.ts +5 -5
- package/dist/mutations/passkey/sign-in-passkey-mutation.d.ts +21 -21
- package/dist/mutations/settings/change-email-mutation.d.ts +5 -5
- package/dist/mutations/settings/change-password-mutation.d.ts +6 -6
- package/dist/mutations/settings/delete-user-mutation.d.ts +4 -4
- package/dist/mutations/settings/link-social-mutation.d.ts +4 -4
- package/dist/mutations/settings/revoke-session-mutation.d.ts +5 -5
- package/dist/mutations/settings/unlink-account-mutation.d.ts +5 -5
- package/dist/mutations/settings/update-user-mutation.d.ts +5 -5
- package/dist/mutations/username/is-username-available-mutation.d.ts +4 -4
- package/dist/mutations/username/sign-in-username-mutation.d.ts +7 -7
- package/dist/plugins/captcha-plugin.d.ts +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +27 -1
- package/dist/queries/api-key/list-api-keys-query.d.ts +6 -6
- package/dist/queries/auth/session-query.d.ts +6 -6
- package/dist/queries/auth-query-options.d.ts +2 -2
- package/dist/queries/multi-session/list-device-sessions-query.d.ts +6 -6
- package/dist/queries/organization/active-organization-query.d.ts +8 -8
- package/dist/queries/organization/full-organization-query.d.ts +6 -6
- package/dist/queries/organization/has-permission-query.d.ts +6 -6
- package/dist/queries/organization/index.d.ts +7 -7
- package/dist/queries/organization/list-invitations-query.d.ts +6 -6
- package/dist/queries/organization/list-members-query.d.ts +6 -6
- package/dist/queries/organization/list-organizations-query.d.ts +6 -6
- package/dist/queries/organization/list-user-invitations-query.d.ts +6 -6
- package/dist/queries/passkey/list-passkeys-query.d.ts +6 -6
- package/dist/queries/settings/account-info-query.d.ts +6 -6
- package/dist/queries/settings/list-accounts-query.d.ts +6 -6
- package/dist/queries/settings/list-sessions-query.d.ts +6 -6
- package/dist/server/queries/api-key/list-api-keys-query.d.ts +5 -5
- package/dist/server/queries/auth/session-query.d.ts +5 -5
- package/dist/server/queries/multi-session/list-device-sessions-query.d.ts +5 -5
- package/dist/server/queries/organization/active-organization-query.d.ts +7 -7
- package/dist/server/queries/organization/full-organization-query.d.ts +5 -5
- package/dist/server/queries/organization/has-permission-query.d.ts +5 -5
- package/dist/server/queries/organization/list-invitations-query.d.ts +5 -5
- package/dist/server/queries/organization/list-members-query.d.ts +5 -5
- package/dist/server/queries/organization/list-organizations-query.d.ts +5 -5
- package/dist/server/queries/organization/list-user-invitations-query.d.ts +5 -5
- package/dist/server/queries/passkey/list-passkeys-query.d.ts +5 -5
- package/dist/server/queries/settings/account-info-query.d.ts +5 -5
- package/dist/server/queries/settings/list-accounts-query.d.ts +5 -5
- package/dist/server/queries/settings/list-sessions-query.d.ts +5 -5
- package/dist/server.d.ts +15 -15
- package/dist/server.js +131 -14
- package/dist/use-auth-plugin-ClcP84Uz.js +80 -0
- package/package.json +2 -2
- package/dist/components/auth/auth-context.js +0 -4
- package/dist/components/auth/auth-provider.js +0 -68
- package/dist/components/auth/email/email-changed.js +0 -70
- package/dist/components/auth/email/email-localization.js +0 -26
- package/dist/components/auth/email/email-styles.js +0 -129
- package/dist/components/auth/email/email-verification.js +0 -75
- package/dist/components/auth/email/index.js +0 -10
- package/dist/components/auth/email/magic-link.js +0 -72
- package/dist/components/auth/email/new-device.js +0 -90
- package/dist/components/auth/email/organization-invitation.js +0 -110
- package/dist/components/auth/email/otp-email.js +0 -65
- package/dist/components/auth/email/password-changed.js +0 -76
- package/dist/components/auth/email/reset-password.js +0 -68
- package/dist/components/auth/fetch-options-provider.js +0 -31
- package/dist/components/icons/apple.js +0 -10
- package/dist/components/icons/atlassian.js +0 -14
- package/dist/components/icons/cognito.js +0 -10
- package/dist/components/icons/discord.js +0 -10
- package/dist/components/icons/dropbox.js +0 -10
- package/dist/components/icons/facebook.js +0 -12
- package/dist/components/icons/figma.js +0 -13
- package/dist/components/icons/github.js +0 -12
- package/dist/components/icons/gitlab.js +0 -10
- package/dist/components/icons/google.js +0 -10
- package/dist/components/icons/huggingface.js +0 -10
- package/dist/components/icons/index.js +0 -35
- package/dist/components/icons/kakao.js +0 -12
- package/dist/components/icons/kick.js +0 -12
- package/dist/components/icons/line.js +0 -10
- package/dist/components/icons/linear.js +0 -10
- package/dist/components/icons/linkedin.js +0 -10
- package/dist/components/icons/microsoft.js +0 -10
- package/dist/components/icons/naver.js +0 -10
- package/dist/components/icons/notion.js +0 -10
- package/dist/components/icons/paybin.js +0 -9
- package/dist/components/icons/paypal.js +0 -10
- package/dist/components/icons/polar.js +0 -10
- package/dist/components/icons/railway.js +0 -10
- package/dist/components/icons/reddit.js +0 -10
- package/dist/components/icons/roblox.js +0 -13
- package/dist/components/icons/salesforce.js +0 -10
- package/dist/components/icons/slack.js +0 -10
- package/dist/components/icons/spotify.js +0 -10
- package/dist/components/icons/tiktok.js +0 -11
- package/dist/components/icons/twitch.js +0 -13
- package/dist/components/icons/vercel.js +0 -10
- package/dist/components/icons/vk.js +0 -10
- package/dist/components/icons/wechat.js +0 -10
- package/dist/components/icons/x.js +0 -10
- package/dist/components/icons/zoom.js +0 -12
- package/dist/components/mutation-invalidator.js +0 -31
- package/dist/components/settings/account/theme-preview.js +0 -10
- package/dist/hooks/auth/use-authenticate.js +0 -29
- package/dist/hooks/auth/use-user.js +0 -15
- package/dist/hooks/use-auth-mutation.js +0 -19
- package/dist/hooks/use-auth-plugin.js +0 -28
- package/dist/hooks/use-auth-query.js +0 -21
- package/dist/lib/auth-client.js +0 -1
- package/dist/lib/auth-plugin.js +0 -1
- package/dist/lib/auth-server.js +0 -1
- package/dist/lib/provider-icons.js +0 -48
- package/dist/lib/settings-tab.js +0 -1
- package/dist/lib/utils.js +0 -5
- package/dist/mutations/api-key/create-api-key-mutation.js +0 -39
- package/dist/mutations/api-key/delete-api-key-mutation.js +0 -39
- package/dist/mutations/auth/request-password-reset-mutation.js +0 -33
- package/dist/mutations/auth/reset-password-mutation.js +0 -34
- package/dist/mutations/auth/send-verification-email-mutation.js +0 -33
- package/dist/mutations/auth/sign-in-email-mutation.js +0 -40
- package/dist/mutations/auth/sign-in-social-mutation.js +0 -38
- package/dist/mutations/auth/sign-out-mutation.js +0 -41
- package/dist/mutations/auth/sign-up-email-mutation.js +0 -36
- package/dist/mutations/auth-mutation-options.js +0 -23
- package/dist/mutations/magic-link/sign-in-magic-link-mutation.js +0 -33
- package/dist/mutations/multi-session/revoke-multi-session-mutation.js +0 -39
- package/dist/mutations/multi-session/set-active-session-mutation.js +0 -40
- package/dist/mutations/organization/accept-invitation-mutation.js +0 -32
- package/dist/mutations/organization/cancel-invitation-mutation.js +0 -28
- package/dist/mutations/organization/check-slug-mutation.js +0 -30
- package/dist/mutations/organization/create-organization-mutation.js +0 -29
- package/dist/mutations/organization/delete-organization-mutation.js +0 -29
- package/dist/mutations/organization/index.js +0 -12
- package/dist/mutations/organization/invite-member-mutation.js +0 -35
- package/dist/mutations/organization/leave-organization-mutation.js +0 -32
- package/dist/mutations/organization/reject-invitation-mutation.js +0 -25
- package/dist/mutations/organization/remove-member-mutation.js +0 -29
- package/dist/mutations/organization/set-active-organization-mutation.js +0 -72
- package/dist/mutations/organization/update-member-role-mutation.js +0 -36
- package/dist/mutations/organization/update-organization-mutation.js +0 -36
- package/dist/mutations/passkey/add-passkey-mutation.js +0 -40
- package/dist/mutations/passkey/delete-passkey-mutation.js +0 -39
- package/dist/mutations/passkey/sign-in-passkey-mutation.js +0 -38
- package/dist/mutations/settings/change-email-mutation.js +0 -37
- package/dist/mutations/settings/change-password-mutation.js +0 -33
- package/dist/mutations/settings/delete-user-mutation.js +0 -33
- package/dist/mutations/settings/link-social-mutation.js +0 -33
- package/dist/mutations/settings/revoke-session-mutation.js +0 -39
- package/dist/mutations/settings/unlink-account-mutation.js +0 -39
- package/dist/mutations/settings/update-user-mutation.js +0 -36
- package/dist/mutations/username/is-username-available-mutation.js +0 -36
- package/dist/mutations/username/sign-in-username-mutation.js +0 -37
- package/dist/plugins/captcha-plugin.js +0 -34
- package/dist/queries/api-key/list-api-keys-query.js +0 -54
- package/dist/queries/auth/session-query.js +0 -72
- package/dist/queries/auth-query-options.js +0 -21
- package/dist/queries/multi-session/list-device-sessions-query.js +0 -85
- package/dist/queries/organization/active-organization-query.js +0 -37
- package/dist/queries/organization/full-organization-query.js +0 -31
- package/dist/queries/organization/has-permission-query.js +0 -38
- package/dist/queries/organization/index.js +0 -7
- package/dist/queries/organization/list-invitations-query.js +0 -37
- package/dist/queries/organization/list-members-query.js +0 -37
- package/dist/queries/organization/list-organizations-query.js +0 -31
- package/dist/queries/organization/list-user-invitations-query.js +0 -31
- package/dist/queries/passkey/list-passkeys-query.js +0 -83
- package/dist/queries/settings/account-info-query.js +0 -87
- package/dist/queries/settings/list-accounts-query.js +0 -85
- package/dist/queries/settings/list-sessions-query.js +0 -83
- package/dist/server/queries/api-key/list-api-keys-query.js +0 -49
- package/dist/server/queries/auth/session-query.js +0 -51
- package/dist/server/queries/multi-session/list-device-sessions-query.js +0 -54
- package/dist/server/queries/organization/active-organization-query.js +0 -25
- package/dist/server/queries/organization/full-organization-query.js +0 -21
- package/dist/server/queries/organization/has-permission-query.js +0 -23
- package/dist/server/queries/organization/list-invitations-query.js +0 -21
- package/dist/server/queries/organization/list-members-query.js +0 -21
- package/dist/server/queries/organization/list-organizations-query.js +0 -21
- package/dist/server/queries/organization/list-user-invitations-query.js +0 -21
- package/dist/server/queries/passkey/list-passkeys-query.js +0 -54
- package/dist/server/queries/settings/account-info-query.js +0 -54
- package/dist/server/queries/settings/list-accounts-query.js +0 -54
- package/dist/server/queries/settings/list-sessions-query.js +0 -54
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { organizationQueryKeys } from "@better-auth-ui/core/plugins";
|
|
2
|
-
import { queryOptions } from "@tanstack/react-query";
|
|
3
|
-
/**
|
|
4
|
-
* Query options factory for members of an organization.
|
|
5
|
-
*
|
|
6
|
-
* @param auth - The Better Auth server instance.
|
|
7
|
-
* @param userId - The signed-in user's ID. Used for cache partitioning so
|
|
8
|
-
* the key matches the client-side `listOrganizationMembersOptions` for SSR hydration.
|
|
9
|
-
* @param params - Parameters forwarded to `auth.api.listMembers`.
|
|
10
|
-
*/
|
|
11
|
-
export function listOrganizationMembersOptions(auth, userId, params) {
|
|
12
|
-
const queryKey = organizationQueryKeys.members.list(userId, params?.query);
|
|
13
|
-
const options = queryOptions({
|
|
14
|
-
queryKey,
|
|
15
|
-
queryFn: () => auth.api.listMembers(params)
|
|
16
|
-
});
|
|
17
|
-
return options;
|
|
18
|
-
}
|
|
19
|
-
export const ensureListOrganizationMembers = (queryClient, auth, userId, params) => queryClient.ensureQueryData(listOrganizationMembersOptions(auth, userId, params));
|
|
20
|
-
export const prefetchListOrganizationMembers = (queryClient, auth, userId, params) => queryClient.prefetchQuery(listOrganizationMembersOptions(auth, userId, params));
|
|
21
|
-
export const fetchListOrganizationMembers = (queryClient, auth, userId, params) => queryClient.fetchQuery(listOrganizationMembersOptions(auth, userId, params));
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { organizationQueryKeys } from "@better-auth-ui/core/plugins";
|
|
2
|
-
import { queryOptions } from "@tanstack/react-query";
|
|
3
|
-
/**
|
|
4
|
-
* Query options factory for organizations the current user belongs to.
|
|
5
|
-
*
|
|
6
|
-
* @param auth - The Better Auth server instance.
|
|
7
|
-
* @param userId - The signed-in user's ID. Used for cache partitioning so
|
|
8
|
-
* the key matches the client-side `listOrganizationsOptions` for SSR hydration.
|
|
9
|
-
* @param params - Parameters forwarded to `auth.api.listOrganizations`.
|
|
10
|
-
*/
|
|
11
|
-
export function listOrganizationsOptions(auth, userId, params) {
|
|
12
|
-
const queryKey = organizationQueryKeys.list(userId, params?.query);
|
|
13
|
-
const options = queryOptions({
|
|
14
|
-
queryKey,
|
|
15
|
-
queryFn: () => auth.api.listOrganizations(params)
|
|
16
|
-
});
|
|
17
|
-
return options;
|
|
18
|
-
}
|
|
19
|
-
export const ensureListOrganizations = (queryClient, auth, userId, params) => queryClient.ensureQueryData(listOrganizationsOptions(auth, userId, params));
|
|
20
|
-
export const prefetchListOrganizations = (queryClient, auth, userId, params) => queryClient.prefetchQuery(listOrganizationsOptions(auth, userId, params));
|
|
21
|
-
export const fetchListOrganizations = (queryClient, auth, userId, params) => queryClient.fetchQuery(listOrganizationsOptions(auth, userId, params));
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { organizationQueryKeys } from "@better-auth-ui/core/plugins";
|
|
2
|
-
import { queryOptions } from "@tanstack/react-query";
|
|
3
|
-
/**
|
|
4
|
-
* Query options factory for invitations addressed to the current user.
|
|
5
|
-
*
|
|
6
|
-
* @param auth - The Better Auth server instance.
|
|
7
|
-
* @param userId - The signed-in user's ID. Used for cache partitioning so
|
|
8
|
-
* the key matches the client-side `listUserInvitationsOptions` for SSR hydration.
|
|
9
|
-
* @param params - Parameters forwarded to `auth.api.listUserInvitations`.
|
|
10
|
-
*/
|
|
11
|
-
export function listUserInvitationsOptions(auth, userId, params) {
|
|
12
|
-
const queryKey = organizationQueryKeys.userInvitations.list(userId, params?.query);
|
|
13
|
-
const options = queryOptions({
|
|
14
|
-
queryKey,
|
|
15
|
-
queryFn: () => auth.api.listUserInvitations(params)
|
|
16
|
-
});
|
|
17
|
-
return options;
|
|
18
|
-
}
|
|
19
|
-
export const ensureListUserInvitations = (queryClient, auth, userId, params) => queryClient.ensureQueryData(listUserInvitationsOptions(auth, userId, params));
|
|
20
|
-
export const prefetchListUserInvitations = (queryClient, auth, userId, params) => queryClient.prefetchQuery(listUserInvitationsOptions(auth, userId, params));
|
|
21
|
-
export const fetchListUserInvitations = (queryClient, auth, userId, params) => queryClient.fetchQuery(listUserInvitationsOptions(auth, userId, params));
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { passkeyQueryKeys } from "@better-auth-ui/core/plugins";
|
|
2
|
-
import { queryOptions } from "@tanstack/react-query";
|
|
3
|
-
/**
|
|
4
|
-
* Query options factory for the current user's passkeys.
|
|
5
|
-
*
|
|
6
|
-
* @param auth - The Better Auth server instance with the passkey plugin.
|
|
7
|
-
* @param userId - The signed-in user's ID. Used for cache partitioning so
|
|
8
|
-
* the key matches the client-side `listPasskeysOptions` for SSR hydration.
|
|
9
|
-
* @param params - Parameters forwarded to `auth.api.listPasskeys`.
|
|
10
|
-
*/
|
|
11
|
-
export function listPasskeysOptions(auth, userId, params) {
|
|
12
|
-
const queryKey = passkeyQueryKeys.list(userId, params?.query);
|
|
13
|
-
const options = queryOptions({
|
|
14
|
-
queryKey,
|
|
15
|
-
queryFn: () => auth.api.listPasskeys(params)
|
|
16
|
-
});
|
|
17
|
-
return options;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get the current user's passkeys from the query cache, calling
|
|
21
|
-
* `fetchListPasskeys` under the hood if no cached entry exists. Resolves
|
|
22
|
-
* with the passkey list, making it suitable for reading directly in a server
|
|
23
|
-
* component.
|
|
24
|
-
*
|
|
25
|
-
* @param queryClient - The React Query client used for SSR hydration.
|
|
26
|
-
* @param auth - The Better Auth server instance with the passkey plugin.
|
|
27
|
-
* @param userId - The signed-in user's ID, used for cache partitioning.
|
|
28
|
-
* @param params - Parameters forwarded to `auth.api.listPasskeys`.
|
|
29
|
-
*/
|
|
30
|
-
export const ensureListPasskeys = (queryClient, auth, userId, params) => queryClient.ensureQueryData(listPasskeysOptions(auth, userId, params));
|
|
31
|
-
/**
|
|
32
|
-
* Prefetch the current user's passkeys into the query cache. Behaves like
|
|
33
|
-
* `fetchListPasskeys`, but does not throw on error and does not return
|
|
34
|
-
* the data — use this when you only need the value to be available after
|
|
35
|
-
* hydration.
|
|
36
|
-
*
|
|
37
|
-
* @param queryClient - The React Query client used for SSR hydration.
|
|
38
|
-
* @param auth - The Better Auth server instance with the passkey plugin.
|
|
39
|
-
* @param userId - The signed-in user's ID, used for cache partitioning.
|
|
40
|
-
* @param params - Parameters forwarded to `auth.api.listPasskeys`.
|
|
41
|
-
*/
|
|
42
|
-
export const prefetchListPasskeys = (queryClient, auth, userId, params) => queryClient.prefetchQuery(listPasskeysOptions(auth, userId, params));
|
|
43
|
-
/**
|
|
44
|
-
* Fetch and cache the current user's passkeys, resolving with the data or
|
|
45
|
-
* throwing on error. If a cached entry exists and is neither invalidated
|
|
46
|
-
* nor older than `staleTime`, the cached value is returned without a
|
|
47
|
-
* network call; otherwise the latest data is fetched.
|
|
48
|
-
*
|
|
49
|
-
* @param queryClient - The React Query client used for SSR hydration.
|
|
50
|
-
* @param auth - The Better Auth server instance with the passkey plugin.
|
|
51
|
-
* @param userId - The signed-in user's ID, used for cache partitioning.
|
|
52
|
-
* @param params - Parameters forwarded to `auth.api.listPasskeys`.
|
|
53
|
-
*/
|
|
54
|
-
export const fetchListPasskeys = (queryClient, auth, userId, params) => queryClient.fetchQuery(listPasskeysOptions(auth, userId, params));
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { authQueryKeys } from "@better-auth-ui/core";
|
|
2
|
-
import { queryOptions } from "@tanstack/react-query";
|
|
3
|
-
/**
|
|
4
|
-
* Query options factory for provider-specific account info.
|
|
5
|
-
*
|
|
6
|
-
* @param auth - The Better Auth server instance.
|
|
7
|
-
* @param userId - The signed-in user's ID. Used for cache partitioning so
|
|
8
|
-
* the key matches the client-side `accountInfoOptions` for SSR hydration.
|
|
9
|
-
* @param params - Parameters forwarded to `auth.api.accountInfo`.
|
|
10
|
-
*/
|
|
11
|
-
export function accountInfoOptions(auth, userId, params) {
|
|
12
|
-
const queryKey = authQueryKeys.accountInfo(userId, params?.query);
|
|
13
|
-
const options = queryOptions({
|
|
14
|
-
queryKey,
|
|
15
|
-
queryFn: () => auth.api.accountInfo(params)
|
|
16
|
-
});
|
|
17
|
-
return options;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get the current user's provider-specific account info from the query
|
|
21
|
-
* cache, calling `fetchAccountInfo` under the hood if no cached entry
|
|
22
|
-
* exists. Resolves with the data, making it suitable for reading directly
|
|
23
|
-
* in a server component.
|
|
24
|
-
*
|
|
25
|
-
* @param queryClient - The React Query client used for SSR hydration.
|
|
26
|
-
* @param auth - The Better Auth server instance.
|
|
27
|
-
* @param userId - The signed-in user's ID, used for cache partitioning.
|
|
28
|
-
* @param params - Parameters forwarded to `auth.api.accountInfo`.
|
|
29
|
-
*/
|
|
30
|
-
export const ensureAccountInfo = (queryClient, auth, userId, params) => queryClient.ensureQueryData(accountInfoOptions(auth, userId, params));
|
|
31
|
-
/**
|
|
32
|
-
* Prefetch the current user's provider-specific account info into the query
|
|
33
|
-
* cache. Behaves like `fetchAccountInfo`, but does not throw on error and
|
|
34
|
-
* does not return the data — use this when you only need the value to be
|
|
35
|
-
* available after hydration.
|
|
36
|
-
*
|
|
37
|
-
* @param queryClient - The React Query client used for SSR hydration.
|
|
38
|
-
* @param auth - The Better Auth server instance.
|
|
39
|
-
* @param userId - The signed-in user's ID, used for cache partitioning.
|
|
40
|
-
* @param params - Parameters forwarded to `auth.api.accountInfo`.
|
|
41
|
-
*/
|
|
42
|
-
export const prefetchAccountInfo = (queryClient, auth, userId, params) => queryClient.prefetchQuery(accountInfoOptions(auth, userId, params));
|
|
43
|
-
/**
|
|
44
|
-
* Fetch and cache the current user's provider-specific account info,
|
|
45
|
-
* resolving with the data or throwing on error. If a cached entry exists
|
|
46
|
-
* and is neither invalidated nor older than `staleTime`, the cached value
|
|
47
|
-
* is returned without a network call; otherwise the latest data is fetched.
|
|
48
|
-
*
|
|
49
|
-
* @param queryClient - The React Query client used for SSR hydration.
|
|
50
|
-
* @param auth - The Better Auth server instance.
|
|
51
|
-
* @param userId - The signed-in user's ID, used for cache partitioning.
|
|
52
|
-
* @param params - Parameters forwarded to `auth.api.accountInfo`.
|
|
53
|
-
*/
|
|
54
|
-
export const fetchAccountInfo = (queryClient, auth, userId, params) => queryClient.fetchQuery(accountInfoOptions(auth, userId, params));
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { authQueryKeys } from "@better-auth-ui/core";
|
|
2
|
-
import { queryOptions } from "@tanstack/react-query";
|
|
3
|
-
/**
|
|
4
|
-
* Query options factory for the current user's linked social accounts.
|
|
5
|
-
*
|
|
6
|
-
* @param auth - The Better Auth server instance.
|
|
7
|
-
* @param userId - The signed-in user's ID. Used for cache partitioning so
|
|
8
|
-
* the key matches the client-side `listAccountsOptions` for SSR hydration.
|
|
9
|
-
* @param params - Parameters forwarded to `auth.api.listUserAccounts`.
|
|
10
|
-
*/
|
|
11
|
-
export function listAccountsOptions(auth, userId, params) {
|
|
12
|
-
const queryKey = authQueryKeys.listAccounts(userId, params?.query);
|
|
13
|
-
const options = queryOptions({
|
|
14
|
-
queryKey,
|
|
15
|
-
queryFn: () => auth.api.listUserAccounts(params)
|
|
16
|
-
});
|
|
17
|
-
return options;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get the current user's linked social accounts from the query cache,
|
|
21
|
-
* calling `fetchListAccounts` under the hood if no cached entry exists.
|
|
22
|
-
* Resolves with the account list, making it suitable for reading directly
|
|
23
|
-
* in a server component.
|
|
24
|
-
*
|
|
25
|
-
* @param queryClient - The React Query client used for SSR hydration.
|
|
26
|
-
* @param auth - The Better Auth server instance.
|
|
27
|
-
* @param userId - The signed-in user's ID, used for cache partitioning.
|
|
28
|
-
* @param params - Parameters forwarded to `auth.api.listUserAccounts`.
|
|
29
|
-
*/
|
|
30
|
-
export const ensureListAccounts = (queryClient, auth, userId, params) => queryClient.ensureQueryData(listAccountsOptions(auth, userId, params));
|
|
31
|
-
/**
|
|
32
|
-
* Prefetch the current user's linked social accounts into the query cache.
|
|
33
|
-
* Behaves like `fetchListAccounts`, but does not throw on error and does
|
|
34
|
-
* not return the data — use this when you only need the value to be
|
|
35
|
-
* available after hydration.
|
|
36
|
-
*
|
|
37
|
-
* @param queryClient - The React Query client used for SSR hydration.
|
|
38
|
-
* @param auth - The Better Auth server instance.
|
|
39
|
-
* @param userId - The signed-in user's ID, used for cache partitioning.
|
|
40
|
-
* @param params - Parameters forwarded to `auth.api.listUserAccounts`.
|
|
41
|
-
*/
|
|
42
|
-
export const prefetchListAccounts = (queryClient, auth, userId, params) => queryClient.prefetchQuery(listAccountsOptions(auth, userId, params));
|
|
43
|
-
/**
|
|
44
|
-
* Fetch and cache the current user's linked social accounts, resolving
|
|
45
|
-
* with the data or throwing on error. If a cached entry exists and is
|
|
46
|
-
* neither invalidated nor older than `staleTime`, the cached value is
|
|
47
|
-
* returned without a network call; otherwise the latest data is fetched.
|
|
48
|
-
*
|
|
49
|
-
* @param queryClient - The React Query client used for SSR hydration.
|
|
50
|
-
* @param auth - The Better Auth server instance.
|
|
51
|
-
* @param userId - The signed-in user's ID, used for cache partitioning.
|
|
52
|
-
* @param params - Parameters forwarded to `auth.api.listUserAccounts`.
|
|
53
|
-
*/
|
|
54
|
-
export const fetchListAccounts = (queryClient, auth, userId, params) => queryClient.fetchQuery(listAccountsOptions(auth, userId, params));
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { authQueryKeys } from "@better-auth-ui/core";
|
|
2
|
-
import { queryOptions } from "@tanstack/react-query";
|
|
3
|
-
/**
|
|
4
|
-
* Query options factory for the current user's active sessions.
|
|
5
|
-
*
|
|
6
|
-
* @param auth - The Better Auth server instance.
|
|
7
|
-
* @param userId - The signed-in user's ID. Used for cache partitioning so
|
|
8
|
-
* the key matches the client-side `listSessionsOptions` for SSR hydration.
|
|
9
|
-
* @param params - Parameters forwarded to `auth.api.listSessions`.
|
|
10
|
-
*/
|
|
11
|
-
export function listSessionsOptions(auth, userId, params) {
|
|
12
|
-
const queryKey = authQueryKeys.listSessions(userId, params?.query);
|
|
13
|
-
const options = queryOptions({
|
|
14
|
-
queryKey,
|
|
15
|
-
queryFn: () => auth.api.listSessions(params)
|
|
16
|
-
});
|
|
17
|
-
return options;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Get the current user's active sessions from the query cache, calling
|
|
21
|
-
* `fetchListSessions` under the hood if no cached entry exists. Resolves
|
|
22
|
-
* with the session list, making it suitable for reading directly in a server
|
|
23
|
-
* component.
|
|
24
|
-
*
|
|
25
|
-
* @param queryClient - The React Query client used for SSR hydration.
|
|
26
|
-
* @param auth - The Better Auth server instance.
|
|
27
|
-
* @param userId - The signed-in user's ID, used for cache partitioning.
|
|
28
|
-
* @param params - Parameters forwarded to `auth.api.listSessions`.
|
|
29
|
-
*/
|
|
30
|
-
export const ensureListSessions = (queryClient, auth, userId, params) => queryClient.ensureQueryData(listSessionsOptions(auth, userId, params));
|
|
31
|
-
/**
|
|
32
|
-
* Prefetch the current user's active sessions into the query cache. Behaves
|
|
33
|
-
* like `fetchListSessions`, but does not throw on error and does not return
|
|
34
|
-
* the data — use this when you only need the value to be available after
|
|
35
|
-
* hydration.
|
|
36
|
-
*
|
|
37
|
-
* @param queryClient - The React Query client used for SSR hydration.
|
|
38
|
-
* @param auth - The Better Auth server instance.
|
|
39
|
-
* @param userId - The signed-in user's ID, used for cache partitioning.
|
|
40
|
-
* @param params - Parameters forwarded to `auth.api.listSessions`.
|
|
41
|
-
*/
|
|
42
|
-
export const prefetchListSessions = (queryClient, auth, userId, params) => queryClient.prefetchQuery(listSessionsOptions(auth, userId, params));
|
|
43
|
-
/**
|
|
44
|
-
* Fetch and cache the current user's active sessions, resolving with the
|
|
45
|
-
* data or throwing on error. If a cached entry exists and is neither
|
|
46
|
-
* invalidated nor older than `staleTime`, the cached value is returned
|
|
47
|
-
* without a network call; otherwise the latest data is fetched.
|
|
48
|
-
*
|
|
49
|
-
* @param queryClient - The React Query client used for SSR hydration.
|
|
50
|
-
* @param auth - The Better Auth server instance.
|
|
51
|
-
* @param userId - The signed-in user's ID, used for cache partitioning.
|
|
52
|
-
* @param params - Parameters forwarded to `auth.api.listSessions`.
|
|
53
|
-
*/
|
|
54
|
-
export const fetchListSessions = (queryClient, auth, userId, params) => queryClient.fetchQuery(listSessionsOptions(auth, userId, params));
|