@better-auth-ui/heroui 1.6.8 → 1.6.9
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/additional-field.d.ts +2 -2
- package/dist/components/auth/additional-field.js +133 -266
- package/dist/components/auth/api-key/api-key-skeleton.js +4 -20
- package/dist/components/auth/api-key/api-key.d.ts +6 -2
- package/dist/components/auth/api-key/api-key.js +16 -54
- package/dist/components/auth/api-key/api-keys-empty.d.ts +3 -1
- package/dist/components/auth/api-key/api-keys-empty.js +8 -34
- package/dist/components/auth/api-key/api-keys.d.ts +10 -2
- package/dist/components/auth/api-key/api-keys.js +21 -40
- package/dist/components/auth/api-key/create-api-key-dialog.d.ts +3 -1
- package/dist/components/auth/api-key/create-api-key-dialog.js +43 -73
- package/dist/components/auth/api-key/delete-api-key-dialog.d.ts +4 -2
- package/dist/components/auth/api-key/delete-api-key-dialog.js +16 -50
- package/dist/components/auth/api-key/new-api-key-dialog.js +23 -59
- package/dist/components/auth/api-key/organization-api-keys.d.ts +14 -0
- package/dist/components/auth/api-key/organization-api-keys.js +22 -0
- package/dist/components/auth/auth-provider.d.ts +1 -1
- package/dist/components/auth/auth-provider.js +10 -16
- package/dist/components/auth/auth.d.ts +3 -3
- package/dist/components/auth/auth.js +86 -61
- package/dist/components/auth/delete-user/danger-zone.d.ts +3 -3
- package/dist/components/auth/delete-user/danger-zone.js +11 -17
- package/dist/components/auth/delete-user/delete-account.d.ts +9 -0
- package/dist/components/auth/delete-user/delete-account.js +50 -0
- package/dist/components/auth/email/email-changed-email.d.ts +2 -2
- package/dist/components/auth/email/email-changed-email.js +22 -29
- package/dist/components/auth/email/email-verification-email.d.ts +2 -2
- package/dist/components/auth/email/email-verification-email.js +22 -29
- package/dist/components/auth/email/magic-link-email.d.ts +2 -2
- package/dist/components/auth/email/magic-link-email.js +22 -29
- package/dist/components/auth/email/new-device-email.d.ts +2 -2
- package/dist/components/auth/email/new-device-email.js +22 -29
- package/dist/components/auth/email/organization-invitation-email.d.ts +3 -0
- package/dist/components/auth/email/organization-invitation-email.js +23 -0
- package/dist/components/auth/email/otp-email.d.ts +2 -2
- package/dist/components/auth/email/otp-email.js +21 -28
- package/dist/components/auth/email/password-changed-email.d.ts +2 -2
- package/dist/components/auth/email/password-changed-email.js +22 -29
- package/dist/components/auth/email/reset-password-email.d.ts +2 -2
- package/dist/components/auth/email/reset-password-email.js +22 -29
- package/dist/components/auth/error-toaster.js +32 -16
- package/dist/components/auth/field-separator.d.ts +1 -1
- package/dist/components/auth/field-separator.js +4 -17
- package/dist/components/auth/forgot-password.d.ts +1 -1
- package/dist/components/auth/forgot-password.js +36 -88
- package/dist/components/auth/magic-link/magic-link-button.d.ts +1 -1
- package/dist/components/auth/magic-link/magic-link-button.js +33 -19
- package/dist/components/auth/magic-link/magic-link.d.ts +2 -2
- package/dist/components/auth/magic-link/magic-link.js +39 -86
- package/dist/components/auth/multi-session/manage-account.d.ts +1 -1
- package/dist/components/auth/multi-session/manage-account.js +32 -48
- package/dist/components/auth/multi-session/manage-accounts.d.ts +1 -1
- package/dist/components/auth/multi-session/manage-accounts.js +32 -33
- package/dist/components/auth/multi-session/switch-account-submenu-content.d.ts +3 -1
- package/dist/components/auth/multi-session/switch-account-submenu-content.js +24 -27
- package/dist/components/auth/multi-session/switch-account-submenu-item.d.ts +3 -2
- package/dist/components/auth/multi-session/switch-account-submenu-item.js +16 -19
- package/dist/components/auth/multi-session/switch-account-submenu.d.ts +2 -1
- package/dist/components/auth/multi-session/switch-account-submenu.js +23 -23
- package/dist/components/auth/organization/change-organization-logo.d.ts +4 -0
- package/dist/components/auth/organization/change-organization-logo.js +69 -0
- package/dist/components/auth/organization/create-organization-dialog.d.ts +13 -0
- package/dist/components/auth/organization/create-organization-dialog.js +37 -0
- package/dist/components/auth/organization/delete-organization-dialog.d.ts +7 -0
- package/dist/components/auth/organization/delete-organization-dialog.js +25 -0
- package/dist/components/auth/organization/delete-organization-skeleton.d.ts +4 -0
- package/dist/components/auth/organization/delete-organization-skeleton.js +8 -0
- package/dist/components/auth/organization/delete-organization.d.ts +5 -0
- package/dist/components/auth/organization/delete-organization.js +27 -0
- package/dist/components/auth/organization/invite-member-dialog.d.ts +13 -0
- package/dist/components/auth/organization/invite-member-dialog.js +47 -0
- package/dist/components/auth/organization/leave-organization-dialog.d.ts +7 -0
- package/dist/components/auth/organization/leave-organization-dialog.js +21 -0
- package/dist/components/auth/organization/leave-organization.d.ts +4 -0
- package/dist/components/auth/organization/leave-organization.js +16 -0
- package/dist/components/auth/organization/organization-danger-zone.d.ts +16 -0
- package/dist/components/auth/organization/organization-danger-zone.js +23 -0
- package/dist/components/auth/organization/organization-invitation-row-skeleton.d.ts +5 -0
- package/dist/components/auth/organization/organization-invitation-row-skeleton.js +9 -0
- package/dist/components/auth/organization/organization-invitation-row.d.ts +5 -0
- package/dist/components/auth/organization/organization-invitation-row.js +31 -0
- package/dist/components/auth/organization/organization-invitations-empty.d.ts +8 -0
- package/dist/components/auth/organization/organization-invitations-empty.js +13 -0
- package/dist/components/auth/organization/organization-invitations.d.ts +9 -0
- package/dist/components/auth/organization/organization-invitations.js +66 -0
- package/dist/components/auth/organization/organization-logo.d.ts +15 -0
- package/dist/components/auth/organization/organization-logo.js +14 -0
- package/dist/components/auth/organization/organization-member-row-skeleton.d.ts +4 -0
- package/dist/components/auth/organization/organization-member-row-skeleton.js +9 -0
- package/dist/components/auth/organization/organization-member-row.d.ts +9 -0
- package/dist/components/auth/organization/organization-member-row.js +34 -0
- package/dist/components/auth/organization/organization-members.d.ts +9 -0
- package/dist/components/auth/organization/organization-members.js +67 -0
- package/dist/components/auth/organization/organization-people.d.ts +10 -0
- package/dist/components/auth/organization/organization-people.js +11 -0
- package/dist/components/auth/organization/organization-profile.d.ts +9 -0
- package/dist/components/auth/organization/organization-profile.js +34 -0
- package/dist/components/auth/organization/organization-row.d.ts +8 -0
- package/dist/components/auth/organization/organization-row.js +31 -0
- package/dist/components/auth/organization/organization-settings.d.ts +12 -0
- package/dist/components/auth/organization/organization-settings.js +13 -0
- package/dist/components/auth/organization/organization-switcher.d.ts +20 -0
- package/dist/components/auth/organization/organization-switcher.js +48 -0
- package/dist/components/auth/organization/organization-view-skeleton.d.ts +6 -0
- package/dist/components/auth/organization/organization-view-skeleton.js +9 -0
- package/dist/components/auth/organization/organization-view.d.ts +15 -0
- package/dist/components/auth/organization/organization-view.js +31 -0
- package/dist/components/auth/organization/organization.d.ts +17 -0
- package/dist/components/auth/organization/organization.js +60 -0
- package/dist/components/auth/organization/organizations-empty.d.ts +4 -0
- package/dist/components/auth/organization/organizations-empty.js +9 -0
- package/dist/components/auth/organization/organizations-settings.d.ts +17 -0
- package/dist/components/auth/organization/organizations-settings.js +17 -0
- package/dist/components/auth/organization/organizations.d.ts +10 -0
- package/dist/components/auth/organization/organizations.js +21 -0
- package/dist/components/auth/organization/remove-member-dialog.d.ts +9 -0
- package/dist/components/auth/organization/remove-member-dialog.js +20 -0
- package/dist/components/auth/organization/slug-field.d.ts +19 -0
- package/dist/components/auth/organization/slug-field.js +38 -0
- package/dist/components/auth/organization/user-invitation-row-skeleton.d.ts +4 -0
- package/dist/components/auth/organization/user-invitation-row-skeleton.js +8 -0
- package/dist/components/auth/organization/user-invitation-row.d.ts +10 -0
- package/dist/components/auth/organization/user-invitation-row.js +22 -0
- package/dist/components/auth/organization/user-invitations-empty.d.ts +4 -0
- package/dist/components/auth/organization/user-invitations-empty.js +12 -0
- package/dist/components/auth/organization/user-invitations.d.ts +10 -0
- package/dist/components/auth/organization/user-invitations.js +18 -0
- package/dist/components/auth/passkey/add-passkey-dialog.js +21 -64
- package/dist/components/auth/passkey/delete-passkey-dialog.js +13 -46
- package/dist/components/auth/passkey/passkey-button.d.ts +1 -1
- package/dist/components/auth/passkey/passkey-button.js +24 -23
- package/dist/components/auth/passkey/passkey-skeleton.js +4 -16
- package/dist/components/auth/passkey/passkey.d.ts +1 -1
- package/dist/components/auth/passkey/passkey.js +16 -47
- package/dist/components/auth/passkey/passkeys-empty.js +8 -34
- package/dist/components/auth/passkey/passkeys.d.ts +1 -1
- package/dist/components/auth/passkey/passkeys.js +15 -41
- package/dist/components/auth/provider-button.d.ts +2 -2
- package/dist/components/auth/provider-button.js +28 -24
- package/dist/components/auth/provider-buttons.js +28 -18
- package/dist/components/auth/reset-password.d.ts +1 -1
- package/dist/components/auth/reset-password.js +56 -146
- package/dist/components/auth/settings/account/account-settings.d.ts +2 -2
- package/dist/components/auth/settings/account/account-settings.js +21 -19
- package/dist/components/auth/settings/account/change-avatar.js +53 -88
- package/dist/components/auth/settings/account/change-email.d.ts +1 -1
- package/dist/components/auth/settings/account/change-email.js +27 -53
- package/dist/components/auth/settings/account/user-profile.d.ts +1 -1
- package/dist/components/auth/settings/account/user-profile.js +64 -85
- package/dist/components/auth/settings/security/active-session.d.ts +1 -1
- package/dist/components/auth/settings/security/active-session.js +50 -57
- package/dist/components/auth/settings/security/active-sessions.d.ts +1 -1
- package/dist/components/auth/settings/security/active-sessions.js +21 -32
- package/dist/components/auth/settings/security/change-password.d.ts +1 -1
- package/dist/components/auth/settings/security/change-password.js +76 -186
- package/dist/components/auth/settings/security/linked-account.d.ts +1 -1
- package/dist/components/auth/settings/security/linked-account.js +37 -55
- package/dist/components/auth/settings/security/linked-accounts.d.ts +1 -1
- package/dist/components/auth/settings/security/linked-accounts.js +34 -43
- package/dist/components/auth/settings/security/security-settings.d.ts +2 -2
- package/dist/components/auth/settings/security/security-settings.js +19 -21
- package/dist/components/auth/settings/settings.d.ts +4 -4
- package/dist/components/auth/settings/settings.js +52 -44
- package/dist/components/auth/sign-in.d.ts +2 -2
- package/dist/components/auth/sign-in.js +63 -132
- package/dist/components/auth/sign-out.js +32 -26
- package/dist/components/auth/sign-up.d.ts +2 -2
- package/dist/components/auth/sign-up.js +97 -211
- package/dist/components/auth/theme/appearance.d.ts +1 -1
- package/dist/components/auth/theme/appearance.js +23 -71
- package/dist/components/auth/theme/theme-toggle-item.js +56 -61
- package/dist/components/auth/user/user-avatar.d.ts +4 -4
- package/dist/components/auth/user/user-avatar.js +31 -28
- package/dist/components/auth/user/user-button.d.ts +6 -7
- package/dist/components/auth/user/user-button.js +38 -72
- package/dist/components/auth/user/user-view.d.ts +13 -7
- package/dist/components/auth/user/user-view.js +26 -36
- package/dist/components/auth/username/sign-in-username.d.ts +2 -2
- package/dist/components/auth/username/sign-in-username.js +87 -147
- package/dist/components/auth/username/username-field.d.ts +1 -1
- package/dist/components/auth/username/username-field.js +44 -52
- package/dist/email.d.ts +8 -7
- package/dist/email.js +8 -8
- package/dist/index.d.ts +21 -21
- package/dist/index.js +21 -22
- package/dist/lib/auth/api-key-plugin.d.ts +7 -4
- package/dist/lib/auth/api-key-plugin.js +12 -10
- package/dist/lib/auth/auth-plugin.d.ts +10 -6
- package/dist/lib/auth/auth-plugin.js +1 -0
- package/dist/lib/auth/delete-user-plugin.d.ts +6 -6
- package/dist/lib/auth/delete-user-plugin.js +6 -9
- package/dist/lib/auth/magic-link-plugin.d.ts +5 -5
- package/dist/lib/auth/magic-link-plugin.js +17 -12
- package/dist/lib/auth/multi-session-plugin.d.ts +5 -5
- package/dist/lib/auth/multi-session-plugin.js +8 -11
- package/dist/lib/auth/organization-plugin.d.ts +37 -0
- package/dist/lib/auth/organization-plugin.js +19 -0
- package/dist/lib/auth/passkey-plugin.d.ts +5 -5
- package/dist/lib/auth/passkey-plugin.js +8 -11
- package/dist/lib/auth/theme-plugin.d.ts +6 -6
- package/dist/lib/auth/theme-plugin.js +25 -22
- package/dist/lib/auth/username-plugin.d.ts +11 -11
- package/dist/lib/auth/username-plugin.js +18 -17
- package/dist/plugins.d.ts +46 -22
- package/dist/plugins.js +47 -22
- package/package.json +25 -19
- package/src/components/auth/api-key/api-key.tsx +25 -16
- package/src/components/auth/api-key/api-keys-empty.tsx +8 -4
- package/src/components/auth/api-key/api-keys.tsx +52 -14
- package/src/components/auth/api-key/create-api-key-dialog.tsx +15 -2
- package/src/components/auth/api-key/delete-api-key-dialog.tsx +10 -2
- package/src/components/auth/api-key/organization-api-keys.tsx +55 -0
- package/src/components/auth/delete-user/danger-zone.tsx +3 -3
- package/src/components/auth/delete-user/{delete-user.tsx → delete-account.tsx} +9 -9
- package/src/components/auth/email/organization-invitation-email.tsx +38 -0
- package/src/components/auth/error-toaster.tsx +28 -10
- package/src/components/auth/forgot-password.tsx +10 -2
- package/src/components/auth/multi-session/manage-accounts.tsx +1 -1
- package/src/components/auth/multi-session/switch-account-submenu-content.tsx +7 -2
- package/src/components/auth/multi-session/switch-account-submenu-item.tsx +4 -2
- package/src/components/auth/multi-session/switch-account-submenu.tsx +8 -4
- package/src/components/auth/organization/change-organization-logo.tsx +171 -0
- package/src/components/auth/organization/create-organization-dialog.tsx +133 -0
- package/src/components/auth/organization/delete-organization-dialog.tsx +97 -0
- package/src/components/auth/organization/delete-organization-skeleton.tsx +17 -0
- package/src/components/auth/organization/delete-organization.tsx +77 -0
- package/src/components/auth/organization/invite-member-dialog.tsx +177 -0
- package/src/components/auth/organization/leave-organization-dialog.tsx +95 -0
- package/src/components/auth/organization/leave-organization.tsx +59 -0
- package/src/components/auth/organization/organization-danger-zone.tsx +68 -0
- package/src/components/auth/organization/organization-invitation-row-skeleton.tsx +29 -0
- package/src/components/auth/organization/organization-invitation-row.tsx +97 -0
- package/src/components/auth/organization/organization-invitations-empty.tsx +39 -0
- package/src/components/auth/organization/organization-invitations.tsx +351 -0
- package/src/components/auth/organization/organization-logo.tsx +64 -0
- package/src/components/auth/organization/organization-member-row-skeleton.tsx +24 -0
- package/src/components/auth/organization/organization-member-row.tsx +157 -0
- package/src/components/auth/organization/organization-members.tsx +284 -0
- package/src/components/auth/organization/organization-people.tsx +26 -0
- package/src/components/auth/organization/organization-profile.tsx +141 -0
- package/src/components/auth/organization/organization-row.tsx +66 -0
- package/src/components/auth/organization/organization-settings.tsx +38 -0
- package/src/components/auth/organization/organization-switcher.tsx +233 -0
- package/src/components/auth/organization/organization-view-skeleton.tsx +36 -0
- package/src/components/auth/organization/organization-view.tsx +109 -0
- package/src/components/auth/organization/organization.tsx +162 -0
- package/src/components/auth/organization/organizations-empty.tsx +35 -0
- package/src/components/auth/organization/organizations-settings.tsx +36 -0
- package/src/components/auth/organization/organizations.tsx +80 -0
- package/src/components/auth/organization/remove-member-dialog.tsx +95 -0
- package/src/components/auth/organization/slug-field.tsx +111 -0
- package/src/components/auth/organization/user-invitation-row-skeleton.tsx +17 -0
- package/src/components/auth/organization/user-invitation-row.tsx +90 -0
- package/src/components/auth/organization/user-invitations-empty.tsx +30 -0
- package/src/components/auth/organization/user-invitations.tsx +59 -0
- package/src/components/auth/settings/account/change-email.tsx +1 -1
- package/src/components/auth/settings/account/user-profile.tsx +5 -5
- package/src/components/auth/settings/security/active-sessions.tsx +6 -4
- package/src/components/auth/settings/security/linked-accounts.tsx +2 -2
- package/src/components/auth/settings/settings.tsx +77 -14
- package/src/components/auth/user/user-avatar.tsx +4 -1
- package/src/components/auth/user/user-button.tsx +14 -11
- package/src/components/auth/user/user-view.tsx +32 -12
- package/src/email.ts +1 -0
- package/src/lib/auth/api-key-plugin.ts +10 -4
- package/src/lib/auth/auth-plugin.ts +6 -1
- package/src/lib/auth/organization-plugin.tsx +32 -0
- package/src/plugins.ts +25 -1
- package/dist/components/auth/delete-user/delete-user.d.ts +0 -9
- package/dist/components/auth/delete-user/delete-user.js +0 -95
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useAuth
|
|
3
|
-
import { cn
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
className: n("text-sm font-semibold mb-3 text-danger"),
|
|
13
|
-
children: c.settings.dangerZone
|
|
14
|
-
}), /* @__PURE__ */ r(e, { variant: o })]
|
|
15
|
-
});
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useAuth } from "@better-auth-ui/react";
|
|
3
|
+
import { cn } from "@heroui/react";
|
|
4
|
+
import { DeleteAccount } from "./delete-account";
|
|
5
|
+
/**
|
|
6
|
+
* Renders the danger zone heading and {@link DeleteAccount}.
|
|
7
|
+
* Registered as a `securityCard` by `deleteUserPlugin()`; gate by registering the plugin.
|
|
8
|
+
*/
|
|
9
|
+
export function DangerZone({ className, variant, ...props }) {
|
|
10
|
+
const { localization } = useAuth();
|
|
11
|
+
return (_jsxs("div", { className: cn("flex w-full flex-col", className), ...props, children: [_jsx("h2", { className: cn("text-sm font-semibold mb-3 text-danger"), children: localization.settings.dangerZone }), _jsx(DeleteAccount, { variant: variant })] }));
|
|
16
12
|
}
|
|
17
|
-
//#endregion
|
|
18
|
-
export { a as DangerZone };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CardProps } from "@heroui/react";
|
|
2
|
+
export type DeleteAccountProps = {
|
|
3
|
+
className?: string;
|
|
4
|
+
variant?: CardProps["variant"];
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Danger-zone card to delete the authenticated account, with a confirmation dialog and toasts.
|
|
8
|
+
*/
|
|
9
|
+
export declare function DeleteAccount({ className, variant, ...props }: DeleteAccountProps & Omit<CardProps, "children">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { authQueryKeys } from "@better-auth-ui/core";
|
|
3
|
+
import { useAuth, useAuthPlugin, useDeleteUser, useListAccounts } from "@better-auth-ui/react";
|
|
4
|
+
import { TriangleExclamation } from "@gravity-ui/icons";
|
|
5
|
+
import { AlertDialog, Button, Card, FieldError, Form, Input, Label, Spinner, TextField, toast } from "@heroui/react";
|
|
6
|
+
import { useQueryClient } from "@tanstack/react-query";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { deleteUserPlugin } from "../../../lib/auth/delete-user-plugin";
|
|
9
|
+
/**
|
|
10
|
+
* Danger-zone card to delete the authenticated account, with a confirmation dialog and toasts.
|
|
11
|
+
*/
|
|
12
|
+
export function DeleteAccount({ className, variant, ...props }) {
|
|
13
|
+
const { authClient, basePaths, localization, navigate, viewPaths } = useAuth();
|
|
14
|
+
const { localization: deleteUserLocalization, sendDeleteAccountVerification } = useAuthPlugin(deleteUserPlugin);
|
|
15
|
+
const { data: accounts } = useListAccounts(authClient);
|
|
16
|
+
const queryClient = useQueryClient();
|
|
17
|
+
const [confirmOpen, setConfirmOpen] = useState(false);
|
|
18
|
+
const [password, setPassword] = useState("");
|
|
19
|
+
const hasCredentialAccount = accounts?.some((account) => account.providerId === "credential");
|
|
20
|
+
const needsPassword = !sendDeleteAccountVerification && hasCredentialAccount;
|
|
21
|
+
const { mutate: deleteUser, isPending } = useDeleteUser(authClient);
|
|
22
|
+
const handleDialogOpenChange = (open) => {
|
|
23
|
+
setConfirmOpen(open);
|
|
24
|
+
setPassword("");
|
|
25
|
+
};
|
|
26
|
+
const handleSubmit = async (e) => {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
const params = {
|
|
29
|
+
...(needsPassword ? { password } : {})
|
|
30
|
+
};
|
|
31
|
+
deleteUser(params, {
|
|
32
|
+
onSuccess: () => {
|
|
33
|
+
setConfirmOpen(false);
|
|
34
|
+
setPassword("");
|
|
35
|
+
if (sendDeleteAccountVerification) {
|
|
36
|
+
toast.success(deleteUserLocalization.deleteUserVerificationSent);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
toast.success(deleteUserLocalization.deleteUserSuccess);
|
|
40
|
+
queryClient.removeQueries({ queryKey: authQueryKeys.all });
|
|
41
|
+
navigate({
|
|
42
|
+
to: `${basePaths.auth}/${viewPaths.auth.signIn}`,
|
|
43
|
+
replace: true
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
return (_jsx(Card, { className: className, variant: variant, ...props, children: _jsxs(Card.Content, { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [_jsxs("div", { children: [_jsx("p", { className: "text-sm font-medium leading-tight", children: deleteUserLocalization.deleteAccount }), _jsx("p", { className: "text-muted text-xs mt-0.5", children: deleteUserLocalization.deleteAccountDescription })] }), _jsxs(AlertDialog, { children: [_jsx(Button, { isDisabled: !accounts, size: "sm", variant: "danger-soft", onPress: () => setConfirmOpen(true), children: deleteUserLocalization.deleteAccount }), _jsx(AlertDialog.Backdrop, { isOpen: confirmOpen, onOpenChange: handleDialogOpenChange, children: _jsx(AlertDialog.Container, { children: _jsx(AlertDialog.Dialog, { children: _jsxs(Form, { onSubmit: handleSubmit, children: [_jsx(AlertDialog.CloseTrigger, {}), _jsxs(AlertDialog.Header, { children: [_jsx(AlertDialog.Icon, { status: "danger", children: _jsx(TriangleExclamation, {}) }), _jsx(AlertDialog.Heading, { children: deleteUserLocalization.deleteAccount })] }), _jsxs(AlertDialog.Body, { className: "overflow-visible", children: [_jsx("p", { className: "text-muted text-sm", children: deleteUserLocalization.deleteAccountDescription }), needsPassword && (_jsxs(TextField, { className: "mt-4", name: "password", type: "password", isDisabled: isPending, value: password, onChange: setPassword, children: [_jsx(Label, { children: localization.auth.password }), _jsx(Input, { autoComplete: "current-password", placeholder: localization.auth.passwordPlaceholder, required: true, variant: "secondary" }), _jsx(FieldError, {})] }))] }), _jsxs(AlertDialog.Footer, { children: [_jsx(Button, { slot: "close", variant: "tertiary", isDisabled: isPending, children: localization.settings.cancel }), _jsxs(Button, { type: "submit", variant: "danger", isPending: isPending, children: [isPending && _jsx(Spinner, { color: "current", size: "sm" }), deleteUserLocalization.deleteAccount] })] })] }) }) }) })] })] }) }));
|
|
50
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { EmailChangedEmailProps } from
|
|
2
|
-
export type { EmailChangedEmailProps } from
|
|
1
|
+
import { type EmailChangedEmailProps } from "@better-auth-ui/react/email";
|
|
2
|
+
export type { EmailChangedEmailProps } from "@better-auth-ui/react/email";
|
|
3
3
|
export declare function EmailChangedEmail({ colors, classNames, ...props }: EmailChangedEmailProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
card: e("border-none rounded-3xl", i?.card),
|
|
24
|
-
button: e("rounded-full", i?.button)
|
|
25
|
-
},
|
|
26
|
-
...a
|
|
27
|
-
});
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { EmailChangedEmail as EmailChangedEmailPrimitive } from "@better-auth-ui/react/email";
|
|
3
|
+
import { cn } from "@heroui/react";
|
|
4
|
+
export function EmailChangedEmail({ colors, classNames, ...props }) {
|
|
5
|
+
return (_jsx(EmailChangedEmailPrimitive, { colors: {
|
|
6
|
+
light: {
|
|
7
|
+
background: "#F5F5F5",
|
|
8
|
+
primary: "#0285F7",
|
|
9
|
+
primaryForeground: "#FCFCFC",
|
|
10
|
+
...colors?.light
|
|
11
|
+
},
|
|
12
|
+
dark: {
|
|
13
|
+
background: "#060607",
|
|
14
|
+
primary: "#0584F6",
|
|
15
|
+
primaryForeground: "#FCFCFC",
|
|
16
|
+
...colors?.dark
|
|
17
|
+
}
|
|
18
|
+
}, classNames: {
|
|
19
|
+
...classNames,
|
|
20
|
+
card: cn("border-none rounded-3xl", classNames?.card),
|
|
21
|
+
button: cn("rounded-full", classNames?.button)
|
|
22
|
+
}, ...props }));
|
|
28
23
|
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { r as EmailChangedEmail };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { EmailVerificationEmailProps } from
|
|
2
|
-
export type { EmailVerificationEmailProps } from
|
|
1
|
+
import { type EmailVerificationEmailProps } from "@better-auth-ui/react/email";
|
|
2
|
+
export type { EmailVerificationEmailProps } from "@better-auth-ui/react/email";
|
|
3
3
|
export declare function EmailVerificationEmail({ colors, classNames, ...props }: EmailVerificationEmailProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
card: e("border-none rounded-3xl", i?.card),
|
|
24
|
-
button: e("rounded-full", i?.button)
|
|
25
|
-
},
|
|
26
|
-
...a
|
|
27
|
-
});
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { EmailVerificationEmail as EmailVerificationEmailPrimitive } from "@better-auth-ui/react/email";
|
|
3
|
+
import { cn } from "@heroui/react";
|
|
4
|
+
export function EmailVerificationEmail({ colors, classNames, ...props }) {
|
|
5
|
+
return (_jsx(EmailVerificationEmailPrimitive, { colors: {
|
|
6
|
+
light: {
|
|
7
|
+
background: "#F5F5F5",
|
|
8
|
+
primary: "#0285F7",
|
|
9
|
+
primaryForeground: "#FCFCFC",
|
|
10
|
+
...colors?.light
|
|
11
|
+
},
|
|
12
|
+
dark: {
|
|
13
|
+
background: "#060607",
|
|
14
|
+
primary: "#0584F6",
|
|
15
|
+
primaryForeground: "#FCFCFC",
|
|
16
|
+
...colors?.dark
|
|
17
|
+
}
|
|
18
|
+
}, classNames: {
|
|
19
|
+
...classNames,
|
|
20
|
+
card: cn("border-none rounded-3xl", classNames?.card),
|
|
21
|
+
button: cn("rounded-full", classNames?.button)
|
|
22
|
+
}, ...props }));
|
|
28
23
|
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { r as EmailVerificationEmail };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { MagicLinkEmailProps } from
|
|
2
|
-
export type { MagicLinkEmailProps } from
|
|
1
|
+
import { type MagicLinkEmailProps } from "@better-auth-ui/react/email";
|
|
2
|
+
export type { MagicLinkEmailProps } from "@better-auth-ui/react/email";
|
|
3
3
|
export declare function MagicLinkEmail({ colors, classNames, ...props }: MagicLinkEmailProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
card: e("border-none rounded-3xl", i?.card),
|
|
24
|
-
button: e("rounded-full", i?.button)
|
|
25
|
-
},
|
|
26
|
-
...a
|
|
27
|
-
});
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { MagicLinkEmail as MagicLinkEmailPrimitive } from "@better-auth-ui/react/email";
|
|
3
|
+
import { cn } from "@heroui/react";
|
|
4
|
+
export function MagicLinkEmail({ colors, classNames, ...props }) {
|
|
5
|
+
return (_jsx(MagicLinkEmailPrimitive, { colors: {
|
|
6
|
+
light: {
|
|
7
|
+
background: "#F5F5F5",
|
|
8
|
+
primary: "#0285F7",
|
|
9
|
+
primaryForeground: "#FCFCFC",
|
|
10
|
+
...colors?.light
|
|
11
|
+
},
|
|
12
|
+
dark: {
|
|
13
|
+
background: "#060607",
|
|
14
|
+
primary: "#0584F6",
|
|
15
|
+
primaryForeground: "#FCFCFC",
|
|
16
|
+
...colors?.dark
|
|
17
|
+
}
|
|
18
|
+
}, classNames: {
|
|
19
|
+
...classNames,
|
|
20
|
+
card: cn("border-none rounded-3xl", classNames?.card),
|
|
21
|
+
button: cn("rounded-full", classNames?.button)
|
|
22
|
+
}, ...props }));
|
|
28
23
|
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { r as MagicLinkEmail };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { NewDeviceEmailProps } from
|
|
2
|
-
export type { NewDeviceEmailProps } from
|
|
1
|
+
import { type NewDeviceEmailProps } from "@better-auth-ui/react/email";
|
|
2
|
+
export type { NewDeviceEmailProps } from "@better-auth-ui/react/email";
|
|
3
3
|
export declare function NewDeviceEmail({ colors, classNames, ...props }: NewDeviceEmailProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
card: e("border-none rounded-3xl", i?.card),
|
|
24
|
-
button: e("rounded-full", i?.button)
|
|
25
|
-
},
|
|
26
|
-
...a
|
|
27
|
-
});
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { NewDeviceEmail as NewDeviceEmailPrimitive } from "@better-auth-ui/react/email";
|
|
3
|
+
import { cn } from "@heroui/react";
|
|
4
|
+
export function NewDeviceEmail({ colors, classNames, ...props }) {
|
|
5
|
+
return (_jsx(NewDeviceEmailPrimitive, { colors: {
|
|
6
|
+
light: {
|
|
7
|
+
background: "#F5F5F5",
|
|
8
|
+
primary: "#0285F7",
|
|
9
|
+
primaryForeground: "#FCFCFC",
|
|
10
|
+
...colors?.light
|
|
11
|
+
},
|
|
12
|
+
dark: {
|
|
13
|
+
background: "#060607",
|
|
14
|
+
primary: "#0584F6",
|
|
15
|
+
primaryForeground: "#FCFCFC",
|
|
16
|
+
...colors?.dark
|
|
17
|
+
}
|
|
18
|
+
}, classNames: {
|
|
19
|
+
...classNames,
|
|
20
|
+
card: cn("border-none rounded-3xl", classNames?.card),
|
|
21
|
+
button: cn("rounded-full", classNames?.button)
|
|
22
|
+
}, ...props }));
|
|
28
23
|
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { r as NewDeviceEmail };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type OrganizationInvitationEmailProps } from "@better-auth-ui/react/email";
|
|
2
|
+
export type { OrganizationInvitationEmailProps } from "@better-auth-ui/react/email";
|
|
3
|
+
export declare function OrganizationInvitationEmail({ colors, classNames, ...props }: OrganizationInvitationEmailProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { OrganizationInvitationEmail as OrganizationInvitationEmailPrimitive } from "@better-auth-ui/react/email";
|
|
3
|
+
import { cn } from "@heroui/react";
|
|
4
|
+
export function OrganizationInvitationEmail({ colors, classNames, ...props }) {
|
|
5
|
+
return (_jsx(OrganizationInvitationEmailPrimitive, { colors: {
|
|
6
|
+
light: {
|
|
7
|
+
background: "#F5F5F5",
|
|
8
|
+
primary: "#0285F7",
|
|
9
|
+
primaryForeground: "#FCFCFC",
|
|
10
|
+
...colors?.light
|
|
11
|
+
},
|
|
12
|
+
dark: {
|
|
13
|
+
background: "#060607",
|
|
14
|
+
primary: "#0584F6",
|
|
15
|
+
primaryForeground: "#FCFCFC",
|
|
16
|
+
...colors?.dark
|
|
17
|
+
}
|
|
18
|
+
}, classNames: {
|
|
19
|
+
...classNames,
|
|
20
|
+
card: cn("border-none rounded-3xl", classNames?.card),
|
|
21
|
+
button: cn("rounded-full", classNames?.button)
|
|
22
|
+
}, ...props }));
|
|
23
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { OtpEmailProps } from
|
|
2
|
-
export type { OtpEmailProps } from
|
|
1
|
+
import { type OtpEmailProps } from "@better-auth-ui/react/email";
|
|
2
|
+
export type { OtpEmailProps } from "@better-auth-ui/react/email";
|
|
3
3
|
export declare function OtpEmail({ colors, classNames, ...props }: OtpEmailProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,29 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
...i,
|
|
23
|
-
card: e("border-none rounded-3xl", i?.card)
|
|
24
|
-
},
|
|
25
|
-
...a
|
|
26
|
-
});
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { OtpEmail as OtpEmailPrimitive } from "@better-auth-ui/react/email";
|
|
3
|
+
import { cn } from "@heroui/react";
|
|
4
|
+
export function OtpEmail({ colors, classNames, ...props }) {
|
|
5
|
+
return (_jsx(OtpEmailPrimitive, { colors: {
|
|
6
|
+
light: {
|
|
7
|
+
background: "#F5F5F5",
|
|
8
|
+
primary: "#0285F7",
|
|
9
|
+
primaryForeground: "#FCFCFC",
|
|
10
|
+
...colors?.light
|
|
11
|
+
},
|
|
12
|
+
dark: {
|
|
13
|
+
background: "#060607",
|
|
14
|
+
primary: "#0584F6",
|
|
15
|
+
primaryForeground: "#FCFCFC",
|
|
16
|
+
...colors?.dark
|
|
17
|
+
}
|
|
18
|
+
}, classNames: {
|
|
19
|
+
...classNames,
|
|
20
|
+
card: cn("border-none rounded-3xl", classNames?.card)
|
|
21
|
+
}, ...props }));
|
|
27
22
|
}
|
|
28
|
-
//#endregion
|
|
29
|
-
export { r as OtpEmail };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { PasswordChangedEmailProps } from
|
|
2
|
-
export type { PasswordChangedEmailProps } from
|
|
1
|
+
import { type PasswordChangedEmailProps } from "@better-auth-ui/react/email";
|
|
2
|
+
export type { PasswordChangedEmailProps } from "@better-auth-ui/react/email";
|
|
3
3
|
export declare function PasswordChangedEmail({ colors, classNames, ...props }: PasswordChangedEmailProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
card: e("border-none rounded-3xl", i?.card),
|
|
24
|
-
button: e("rounded-full", i?.button)
|
|
25
|
-
},
|
|
26
|
-
...a
|
|
27
|
-
});
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PasswordChangedEmail as PasswordChangedEmailPrimitive } from "@better-auth-ui/react/email";
|
|
3
|
+
import { cn } from "@heroui/react";
|
|
4
|
+
export function PasswordChangedEmail({ colors, classNames, ...props }) {
|
|
5
|
+
return (_jsx(PasswordChangedEmailPrimitive, { colors: {
|
|
6
|
+
light: {
|
|
7
|
+
background: "#F5F5F5",
|
|
8
|
+
primary: "#0285F7",
|
|
9
|
+
primaryForeground: "#FCFCFC",
|
|
10
|
+
...colors?.light
|
|
11
|
+
},
|
|
12
|
+
dark: {
|
|
13
|
+
background: "#060607",
|
|
14
|
+
primary: "#0584F6",
|
|
15
|
+
primaryForeground: "#FCFCFC",
|
|
16
|
+
...colors?.dark
|
|
17
|
+
}
|
|
18
|
+
}, classNames: {
|
|
19
|
+
...classNames,
|
|
20
|
+
card: cn("border-none rounded-3xl", classNames?.card),
|
|
21
|
+
button: cn("rounded-full", classNames?.button)
|
|
22
|
+
}, ...props }));
|
|
28
23
|
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { r as PasswordChangedEmail };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ResetPasswordEmailProps } from
|
|
2
|
-
export type { ResetPasswordEmailProps } from
|
|
1
|
+
import { type ResetPasswordEmailProps } from "@better-auth-ui/react/email";
|
|
2
|
+
export type { ResetPasswordEmailProps } from "@better-auth-ui/react/email";
|
|
3
3
|
export declare function ResetPasswordEmail({ colors, classNames, ...props }: ResetPasswordEmailProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,30 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
card: e("border-none rounded-3xl", i?.card),
|
|
24
|
-
button: e("rounded-full", i?.button)
|
|
25
|
-
},
|
|
26
|
-
...a
|
|
27
|
-
});
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ResetPasswordEmail as ResetPasswordEmailPrimitive } from "@better-auth-ui/react/email";
|
|
3
|
+
import { cn } from "@heroui/react";
|
|
4
|
+
export function ResetPasswordEmail({ colors, classNames, ...props }) {
|
|
5
|
+
return (_jsx(ResetPasswordEmailPrimitive, { colors: {
|
|
6
|
+
light: {
|
|
7
|
+
background: "#F5F5F5",
|
|
8
|
+
primary: "#0285F7",
|
|
9
|
+
primaryForeground: "#FCFCFC",
|
|
10
|
+
...colors?.light
|
|
11
|
+
},
|
|
12
|
+
dark: {
|
|
13
|
+
background: "#060607",
|
|
14
|
+
primary: "#0584F6",
|
|
15
|
+
primaryForeground: "#FCFCFC",
|
|
16
|
+
...colors?.dark
|
|
17
|
+
}
|
|
18
|
+
}, classNames: {
|
|
19
|
+
...classNames,
|
|
20
|
+
card: cn("border-none rounded-3xl", classNames?.card),
|
|
21
|
+
button: cn("rounded-full", classNames?.button)
|
|
22
|
+
}, ...props }));
|
|
28
23
|
}
|
|
29
|
-
//#endregion
|
|
30
|
-
export { r as ResetPasswordEmail };
|
|
@@ -1,17 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
function
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { authMutationKeys, authQueryKeys } from "@better-auth-ui/core";
|
|
2
|
+
import { toast } from "@heroui/react";
|
|
3
|
+
import { matchMutation, matchQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
|
+
import { useEffect } from "react";
|
|
5
|
+
export function ErrorToaster() {
|
|
6
|
+
const queryClient = useQueryClient();
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const unsubscribeQuery = queryClient.getQueryCache().subscribe((event) => {
|
|
9
|
+
if (event.type !== "updated" || event.action.type !== "error")
|
|
10
|
+
return;
|
|
11
|
+
if (!matchQuery({ queryKey: authQueryKeys.all }, event.query))
|
|
12
|
+
return;
|
|
13
|
+
const err = event.action.error;
|
|
14
|
+
if (err?.error)
|
|
15
|
+
toast.danger(err.error.message);
|
|
16
|
+
});
|
|
17
|
+
const unsubscribeMutation = queryClient
|
|
18
|
+
.getMutationCache()
|
|
19
|
+
.subscribe((event) => {
|
|
20
|
+
if (event.type !== "updated" || event.action.type !== "error")
|
|
21
|
+
return;
|
|
22
|
+
if (!matchMutation({ mutationKey: authMutationKeys.all }, event.mutation))
|
|
23
|
+
return;
|
|
24
|
+
const err = event.action.error;
|
|
25
|
+
toast.danger(err.error?.message || err.message);
|
|
26
|
+
});
|
|
27
|
+
return () => {
|
|
28
|
+
unsubscribeQuery();
|
|
29
|
+
unsubscribeMutation();
|
|
30
|
+
};
|
|
31
|
+
}, [queryClient]);
|
|
32
|
+
return null;
|
|
15
33
|
}
|
|
16
|
-
//#endregion
|
|
17
|
-
export { r as ErrorToaster };
|