@better-auth-ui/heroui 1.6.3 → 1.6.5
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 +4 -0
- package/dist/components/auth/additional-field.js +270 -0
- package/dist/components/auth/auth-provider.d.ts +4 -6
- package/dist/components/auth/auth.d.ts +1 -1
- package/dist/components/auth/auth.js +54 -28
- package/dist/components/{settings/security → auth/delete-user}/danger-zone.d.ts +1 -1
- package/dist/components/{settings/security → auth/delete-user}/danger-zone.js +1 -1
- package/dist/components/auth/delete-user/delete-user.js +95 -0
- package/dist/components/{email → auth/email}/email-changed-email.d.ts +2 -2
- package/dist/components/{email → auth/email}/email-changed-email.js +7 -7
- package/dist/components/{email → auth/email}/email-verification-email.d.ts +2 -2
- package/dist/components/{email → auth/email}/email-verification-email.js +7 -7
- package/dist/components/auth/email/magic-link-email.d.ts +3 -0
- package/dist/components/{email → auth/email}/magic-link-email.js +7 -7
- package/dist/components/auth/email/new-device-email.d.ts +3 -0
- package/dist/components/{email → auth/email}/new-device-email.js +7 -7
- package/dist/components/auth/email/otp-email.d.ts +3 -0
- package/dist/components/{email → auth/email}/otp-email.js +6 -6
- package/dist/components/{email → auth/email}/password-changed-email.d.ts +2 -2
- package/dist/components/{email → auth/email}/password-changed-email.js +7 -7
- package/dist/components/{email → auth/email}/reset-password-email.d.ts +2 -2
- package/dist/components/{email → auth/email}/reset-password-email.js +7 -7
- package/dist/components/auth/forgot-password.d.ts +1 -1
- package/dist/components/auth/forgot-password.js +70 -48
- package/dist/components/auth/magic-link/magic-link-button.d.ts +11 -0
- package/dist/components/auth/magic-link/magic-link-button.js +20 -0
- package/dist/components/auth/magic-link/magic-link.d.ts +16 -0
- package/dist/components/auth/magic-link/magic-link.js +87 -0
- package/dist/components/{settings/account → auth/multi-session}/manage-account.d.ts +2 -6
- package/dist/components/auth/multi-session/manage-account.js +49 -0
- package/dist/components/auth/multi-session/manage-accounts.js +34 -0
- package/dist/components/{user/switch-account-menu.d.ts → auth/multi-session/switch-account-submenu-content.d.ts} +3 -3
- package/dist/components/auth/multi-session/switch-account-submenu-content.js +29 -0
- package/dist/components/{user/switch-account-item.d.ts → auth/multi-session/switch-account-submenu-item.d.ts} +2 -2
- package/dist/components/auth/multi-session/switch-account-submenu-item.js +20 -0
- package/dist/components/auth/multi-session/switch-account-submenu.d.ts +13 -0
- package/dist/components/auth/multi-session/switch-account-submenu.js +24 -0
- package/dist/components/auth/passkey/passkey-button.d.ts +6 -0
- package/dist/components/auth/passkey/passkey-button.js +24 -0
- package/dist/components/auth/passkey/passkey.js +45 -0
- package/dist/components/auth/passkey/passkeys.js +106 -0
- package/dist/components/auth/provider-button.d.ts +6 -8
- package/dist/components/auth/provider-button.js +16 -20
- package/dist/components/auth/provider-buttons.d.ts +3 -4
- package/dist/components/auth/provider-buttons.js +9 -10
- package/dist/components/auth/reset-password.js +110 -107
- package/dist/components/{settings → auth/settings}/account/account-settings.d.ts +5 -2
- package/dist/components/auth/settings/account/account-settings.js +20 -0
- package/dist/components/auth/settings/account/change-avatar.js +89 -0
- package/dist/components/{settings → auth/settings}/account/change-email.js +17 -17
- package/dist/components/{settings → auth/settings}/account/user-profile.d.ts +2 -3
- package/dist/components/auth/settings/account/user-profile.js +86 -0
- package/dist/components/auth/settings/security/active-session.js +59 -0
- package/dist/components/{settings → auth/settings}/security/active-sessions.js +4 -4
- package/dist/components/auth/settings/security/change-password.js +189 -0
- package/dist/components/auth/settings/security/linked-account.js +56 -0
- package/dist/components/{settings → auth/settings}/security/linked-accounts.js +5 -5
- package/dist/components/{settings → auth/settings}/security/security-settings.d.ts +1 -1
- package/dist/components/auth/settings/security/security-settings.js +22 -0
- package/dist/components/auth/settings/settings.js +45 -0
- package/dist/components/auth/sign-in.js +66 -85
- package/dist/components/auth/sign-out.js +11 -11
- package/dist/components/auth/sign-up.js +128 -148
- package/dist/components/{settings/account → auth/theme}/appearance.d.ts +3 -6
- package/dist/components/auth/theme/appearance.js +72 -0
- package/dist/components/auth/theme/theme-toggle-item.d.ts +5 -0
- package/dist/components/auth/theme/theme-toggle-item.js +58 -0
- package/dist/components/auth/user/user-avatar.js +29 -0
- package/dist/components/{user → auth/user}/user-button.d.ts +2 -6
- package/dist/components/auth/user/user-button.js +55 -0
- package/dist/components/auth/user/user-view.js +37 -0
- package/dist/components/auth/username/sign-in-username.d.ts +14 -0
- package/dist/components/auth/username/sign-in-username.js +148 -0
- package/dist/components/auth/username/username-field.d.ts +8 -0
- package/dist/components/auth/username/username-field.js +53 -0
- package/dist/email.d.ts +7 -0
- package/dist/email.js +9 -0
- package/dist/index.d.ts +12 -27
- package/dist/index.js +20 -35
- package/dist/lib/auth/auth-plugin.d.ts +44 -0
- package/dist/lib/auth/delete-user-plugin.d.ts +17 -0
- package/dist/lib/auth/delete-user-plugin.js +10 -0
- package/dist/lib/auth/magic-link-plugin.d.ts +31 -0
- package/dist/lib/auth/magic-link-plugin.js +13 -0
- package/dist/lib/auth/multi-session-plugin.d.ts +18 -0
- package/dist/lib/auth/multi-session-plugin.js +12 -0
- package/dist/lib/auth/passkey-plugin.d.ts +20 -0
- package/dist/lib/auth/passkey-plugin.js +12 -0
- package/dist/lib/auth/theme-plugin.d.ts +68 -0
- package/dist/lib/auth/theme-plugin.js +23 -0
- package/dist/lib/auth/username-plugin.d.ts +63 -0
- package/dist/lib/auth/username-plugin.js +18 -0
- package/dist/plugins.d.ts +20 -0
- package/dist/plugins.js +21 -0
- package/package.json +19 -21
- package/src/components/auth/additional-field.tsx +554 -0
- package/src/components/auth/auth-provider.tsx +5 -6
- package/src/components/auth/auth.tsx +99 -35
- package/src/components/{settings/security → auth/delete-user}/danger-zone.tsx +1 -1
- package/src/components/{settings/security → auth/delete-user}/delete-user.tsx +30 -20
- package/src/components/{email → auth/email}/email-changed-email.tsx +2 -2
- package/src/components/{email → auth/email}/email-verification-email.tsx +2 -2
- package/src/components/{email → auth/email}/magic-link-email.tsx +2 -2
- package/src/components/{email → auth/email}/new-device-email.tsx +2 -2
- package/src/components/{email → auth/email}/otp-email.tsx +2 -2
- package/src/components/{email → auth/email}/password-changed-email.tsx +2 -2
- package/src/components/{email → auth/email}/reset-password-email.tsx +2 -2
- package/src/components/auth/forgot-password.tsx +42 -17
- package/src/components/auth/magic-link/magic-link-button.tsx +61 -0
- package/src/components/auth/{magic-link.tsx → magic-link/magic-link.tsx} +55 -40
- package/src/components/{settings/account → auth/multi-session}/manage-account.tsx +16 -13
- package/src/components/{settings/account → auth/multi-session}/manage-accounts.tsx +14 -5
- package/src/components/{user/switch-account-menu.tsx → auth/multi-session/switch-account-submenu-content.tsx} +18 -11
- package/src/components/{user/switch-account-item.tsx → auth/multi-session/switch-account-submenu-item.tsx} +17 -5
- package/src/components/auth/multi-session/switch-account-submenu.tsx +50 -0
- package/src/components/auth/passkey/passkey-button.tsx +56 -0
- package/src/components/{settings/security → auth/passkey}/passkey.tsx +20 -6
- package/src/components/auth/passkey/passkeys.tsx +196 -0
- package/src/components/auth/provider-button.tsx +27 -29
- package/src/components/auth/provider-buttons.tsx +6 -11
- package/src/components/auth/reset-password.tsx +13 -7
- package/src/components/{settings → auth/settings}/account/account-settings.tsx +15 -13
- package/src/components/{settings → auth/settings}/account/change-avatar.tsx +4 -3
- package/src/components/{settings → auth/settings}/account/change-email.tsx +3 -3
- package/src/components/auth/settings/account/user-profile.tsx +171 -0
- package/src/components/{settings → auth/settings}/security/active-session.tsx +8 -5
- package/src/components/{settings → auth/settings}/security/active-sessions.tsx +3 -3
- package/src/components/{settings → auth/settings}/security/change-password.tsx +14 -9
- package/src/components/{settings → auth/settings}/security/linked-account.tsx +12 -8
- package/src/components/{settings → auth/settings}/security/linked-accounts.tsx +2 -2
- package/src/components/{settings → auth/settings}/security/security-settings.tsx +7 -6
- package/src/components/{settings → auth/settings}/settings.tsx +2 -2
- package/src/components/auth/sign-in.tsx +50 -61
- package/src/components/auth/sign-out.tsx +2 -2
- package/src/components/auth/sign-up.tsx +119 -131
- package/src/components/{settings/account → auth/theme}/appearance.tsx +17 -24
- package/src/components/auth/theme/theme-toggle-item.tsx +110 -0
- package/src/components/{user → auth/user}/user-avatar.tsx +12 -4
- package/src/components/{user → auth/user}/user-button.tsx +15 -88
- package/src/components/{user → auth/user}/user-view.tsx +12 -4
- package/src/components/auth/username/sign-in-username.tsx +299 -0
- package/src/components/auth/username/username-field.tsx +124 -0
- package/src/email.ts +9 -0
- package/src/index.tsx +12 -27
- package/src/lib/auth/auth-plugin.ts +67 -0
- package/src/lib/auth/delete-user-plugin.ts +15 -0
- package/src/lib/auth/magic-link-plugin.ts +26 -0
- package/src/lib/auth/multi-session-plugin.ts +17 -0
- package/src/lib/auth/passkey-plugin.ts +17 -0
- package/src/lib/auth/theme-plugin.ts +86 -0
- package/src/lib/auth/username-plugin.tsx +30 -0
- package/src/plugins.ts +23 -0
- package/dist/components/auth/magic-link-button.d.ts +0 -13
- package/dist/components/auth/magic-link-button.js +0 -16
- package/dist/components/auth/magic-link.d.ts +0 -17
- package/dist/components/auth/magic-link.js +0 -99
- package/dist/components/auth/passkey-button.d.ts +0 -4
- package/dist/components/auth/passkey-button.js +0 -21
- package/dist/components/email/magic-link-email.d.ts +0 -3
- package/dist/components/email/new-device-email.d.ts +0 -3
- package/dist/components/email/otp-email.d.ts +0 -3
- package/dist/components/settings/account/account-settings.js +0 -23
- package/dist/components/settings/account/appearance.js +0 -71
- package/dist/components/settings/account/change-avatar.js +0 -89
- package/dist/components/settings/account/manage-account.js +0 -48
- package/dist/components/settings/account/manage-accounts.js +0 -33
- package/dist/components/settings/account/user-profile.js +0 -103
- package/dist/components/settings/security/active-session.js +0 -59
- package/dist/components/settings/security/change-password.js +0 -189
- package/dist/components/settings/security/delete-user.js +0 -92
- package/dist/components/settings/security/linked-account.js +0 -56
- package/dist/components/settings/security/passkey.js +0 -43
- package/dist/components/settings/security/passkeys.js +0 -53
- package/dist/components/settings/security/security-settings.js +0 -25
- package/dist/components/settings/settings.js +0 -45
- package/dist/components/user/switch-account-item.js +0 -20
- package/dist/components/user/switch-account-menu.js +0 -28
- package/dist/components/user/user-avatar.js +0 -29
- package/dist/components/user/user-button.js +0 -91
- package/dist/components/user/user-view.js +0 -37
- package/dist/core.d.ts +0 -1
- package/dist/core.js +0 -1
- package/dist/react-exports.d.ts +0 -1
- package/dist/react-exports.js +0 -1
- package/src/components/auth/magic-link-button.tsx +0 -43
- package/src/components/auth/passkey-button.tsx +0 -35
- package/src/components/settings/account/user-profile.tsx +0 -217
- package/src/components/settings/security/passkeys.tsx +0 -96
- package/src/core.ts +0 -1
- package/src/react-exports.ts +0 -1
- /package/dist/components/{settings/security → auth/delete-user}/delete-user.d.ts +0 -0
- /package/dist/components/{settings/account → auth/multi-session}/manage-accounts.d.ts +0 -0
- /package/dist/components/{settings/security → auth/passkey}/passkey.d.ts +0 -0
- /package/dist/components/{settings/security → auth/passkey}/passkeys.d.ts +0 -0
- /package/dist/components/{settings → auth/settings}/account/change-avatar.d.ts +0 -0
- /package/dist/components/{settings → auth/settings}/account/change-email.d.ts +0 -0
- /package/dist/components/{settings → auth/settings}/security/active-session.d.ts +0 -0
- /package/dist/components/{settings → auth/settings}/security/active-sessions.d.ts +0 -0
- /package/dist/components/{settings → auth/settings}/security/change-password.d.ts +0 -0
- /package/dist/components/{settings → auth/settings}/security/linked-account.d.ts +0 -0
- /package/dist/components/{settings → auth/settings}/security/linked-accounts.d.ts +0 -0
- /package/dist/components/{settings → auth/settings}/settings.d.ts +0 -0
- /package/dist/components/{user → auth/user}/user-avatar.d.ts +0 -0
- /package/dist/components/{user → auth/user}/user-view.d.ts +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AccountSettings as e } from "./account/account-settings.js";
|
|
2
|
+
import { SecuritySettings as t } from "./security/security-settings.js";
|
|
3
|
+
import { useAuth as n, useAuthenticate as r } from "@better-auth-ui/react";
|
|
4
|
+
import { Tabs as i, cn as a } from "@heroui/react";
|
|
5
|
+
import { useMemo as o } from "react";
|
|
6
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
//#region src/components/auth/settings/settings.tsx
|
|
8
|
+
function l({ className: l, hideNav: u, path: d, variant: f, view: p, ...m }) {
|
|
9
|
+
let { authClient: h, basePaths: g, localization: _, viewPaths: v } = n();
|
|
10
|
+
if (r(h), !p && !d) throw Error("[Better Auth UI] Either `view` or `path` must be provided");
|
|
11
|
+
let y = o(() => Object.fromEntries(Object.entries(v.settings).map(([e, t]) => [t, e])), [v.settings]), b = p || (d ? y[d] : void 0);
|
|
12
|
+
return /* @__PURE__ */ c(i, {
|
|
13
|
+
className: a(l),
|
|
14
|
+
orientation: "horizontal",
|
|
15
|
+
selectedKey: b,
|
|
16
|
+
...m,
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ s(i.ListContainer, { children: /* @__PURE__ */ c(i.List, {
|
|
19
|
+
"aria-label": _.settings.settings,
|
|
20
|
+
className: "overflow-auto w-fit",
|
|
21
|
+
children: [/* @__PURE__ */ c(i.Tab, {
|
|
22
|
+
id: "account",
|
|
23
|
+
href: `${g.settings}/${v.settings.account}`,
|
|
24
|
+
children: [_.settings.account, /* @__PURE__ */ s(i.Indicator, {})]
|
|
25
|
+
}), /* @__PURE__ */ c(i.Tab, {
|
|
26
|
+
id: "security",
|
|
27
|
+
href: `${g.settings}/${v.settings.security}`,
|
|
28
|
+
children: [_.settings.security, /* @__PURE__ */ s(i.Indicator, {})]
|
|
29
|
+
})]
|
|
30
|
+
}) }),
|
|
31
|
+
/* @__PURE__ */ s(i.Panel, {
|
|
32
|
+
id: "account",
|
|
33
|
+
className: "px-0",
|
|
34
|
+
children: /* @__PURE__ */ s(e, { variant: f })
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ s(i.Panel, {
|
|
37
|
+
id: "security",
|
|
38
|
+
className: "px-0",
|
|
39
|
+
children: /* @__PURE__ */ s(t, { variant: f })
|
|
40
|
+
})
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
export { l as Settings };
|
|
@@ -1,144 +1,125 @@
|
|
|
1
1
|
import { FieldSeparator as e } from "./field-separator.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { ProviderButtons as t } from "./provider-buttons.js";
|
|
3
|
+
import { authMutationKeys as n } from "@better-auth-ui/core";
|
|
4
|
+
import { useAuth as r, useFetchOptions as i, useSendVerificationEmail as a, useSignInEmail as o } from "@better-auth-ui/react";
|
|
5
|
+
import { Button as s, Card as c, Checkbox as l, Description as u, FieldError as d, Form as f, Input as p, Label as m, Link as h, Spinner as g, TextField as _, cn as v, toast as y } from "@heroui/react";
|
|
6
|
+
import { useState as b } from "react";
|
|
7
7
|
import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
8
|
-
import {
|
|
8
|
+
import { useIsMutating as w } from "@tanstack/react-query";
|
|
9
9
|
//#region src/components/auth/sign-in.tsx
|
|
10
|
-
function T(
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
function E({ className: E, socialLayout: D, socialPosition: O = "bottom", variant: k, ...A }) {
|
|
14
|
-
let { basePaths: j, baseURL: M, emailAndPassword: N, localization: P, magicLink: F, passkey: I, redirectTo: L, socialProviders: R, username: z, viewPaths: B, navigate: V } = i(), [H, U] = w(""), { mutate: W } = a({ onSuccess: () => b.success(P.auth.verificationEmailSent) }), { mutate: G, isPending: K } = o({
|
|
10
|
+
function T({ className: T, socialLayout: E, socialPosition: D = "bottom", variant: O, ...k }) {
|
|
11
|
+
let { authClient: A, basePaths: j, baseURL: M, emailAndPassword: N, localization: P, plugins: F, redirectTo: I, socialProviders: L, viewPaths: R, navigate: z } = r(), { fetchOptions: B, resetFetchOptions: V } = i(), [H, U] = b(""), { mutate: W } = a(A, { onSuccess: () => y.success(P.auth.verificationEmailSent) }), { mutate: G, isPending: K } = o(A, {
|
|
15
12
|
onError: (e, { email: t }) => {
|
|
16
|
-
U(""), e.error?.code === "EMAIL_NOT_VERIFIED" ?
|
|
13
|
+
U(""), e.error?.code === "EMAIL_NOT_VERIFIED" ? y.danger(e.error?.message || e.message, { actionProps: {
|
|
17
14
|
children: P.auth.resend,
|
|
18
15
|
onClick: () => W({
|
|
19
16
|
email: t,
|
|
20
|
-
callbackURL: `${M}${
|
|
17
|
+
callbackURL: `${M}${I}`
|
|
21
18
|
})
|
|
22
|
-
} }) :
|
|
23
|
-
},
|
|
24
|
-
onSuccess: () => V({ to: L })
|
|
25
|
-
}), { mutate: q, isPending: J } = s({
|
|
26
|
-
onError: (e) => {
|
|
27
|
-
U(""), b.danger(e.error?.message || e.message);
|
|
19
|
+
} }) : y.danger(e.error?.message || e.message), V();
|
|
28
20
|
},
|
|
29
|
-
onSuccess: () =>
|
|
30
|
-
}),
|
|
21
|
+
onSuccess: () => z({ to: I })
|
|
22
|
+
}), q = (e) => {
|
|
31
23
|
e.preventDefault();
|
|
32
24
|
let t = new FormData(e.currentTarget), n = t.get("email"), r = t.get("rememberMe") === "on";
|
|
33
|
-
|
|
34
|
-
username: n,
|
|
35
|
-
password: H
|
|
36
|
-
}) : G({
|
|
25
|
+
G({
|
|
37
26
|
email: n,
|
|
38
27
|
password: H,
|
|
39
|
-
...N?.rememberMe ? { rememberMe: r } : {}
|
|
28
|
+
...N?.rememberMe ? { rememberMe: r } : {},
|
|
29
|
+
fetchOptions: B
|
|
40
30
|
});
|
|
41
|
-
},
|
|
42
|
-
return /* @__PURE__ */ C(
|
|
43
|
-
className:
|
|
44
|
-
variant:
|
|
45
|
-
...
|
|
31
|
+
}, J = w({ mutationKey: n.signIn.all }) + w({ mutationKey: n.signUp.all }) > 0, Y = F.find((e) => e.captchaComponent)?.captchaComponent, X = N?.enabled && !!L?.length;
|
|
32
|
+
return /* @__PURE__ */ C(c, {
|
|
33
|
+
className: v("w-full max-w-sm gap-4 md:p-6", T),
|
|
34
|
+
variant: O,
|
|
35
|
+
...k,
|
|
46
36
|
children: [
|
|
47
|
-
/* @__PURE__ */ S(
|
|
37
|
+
/* @__PURE__ */ S(c.Header, { children: /* @__PURE__ */ S(c.Title, {
|
|
48
38
|
className: "text-xl font-semibold mb-1",
|
|
49
39
|
children: P.auth.signIn
|
|
50
40
|
}) }),
|
|
51
|
-
/* @__PURE__ */ C(
|
|
41
|
+
/* @__PURE__ */ C(c.Content, {
|
|
52
42
|
className: "gap-4",
|
|
53
43
|
children: [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}), Z && /* @__PURE__ */ S(e, { children: P.auth.or })] }),
|
|
58
|
-
N?.enabled && /* @__PURE__ */ C(p, {
|
|
59
|
-
onSubmit: Y,
|
|
44
|
+
D === "top" && /* @__PURE__ */ C(x, { children: [!!L?.length && /* @__PURE__ */ S(t, { socialLayout: E }), X && /* @__PURE__ */ S(e, { children: P.auth.or })] }),
|
|
45
|
+
N?.enabled && /* @__PURE__ */ C(f, {
|
|
46
|
+
onSubmit: q,
|
|
60
47
|
className: "flex flex-col gap-4",
|
|
61
48
|
children: [
|
|
62
|
-
/* @__PURE__ */ C(
|
|
49
|
+
/* @__PURE__ */ C(_, {
|
|
63
50
|
name: "email",
|
|
64
|
-
type:
|
|
65
|
-
autoComplete:
|
|
66
|
-
isDisabled:
|
|
51
|
+
type: "email",
|
|
52
|
+
autoComplete: "email",
|
|
53
|
+
isDisabled: J,
|
|
67
54
|
children: [
|
|
68
|
-
/* @__PURE__ */ S(
|
|
69
|
-
/* @__PURE__ */ S(
|
|
70
|
-
placeholder:
|
|
71
|
-
variant:
|
|
55
|
+
/* @__PURE__ */ S(m, { children: P.auth.email }),
|
|
56
|
+
/* @__PURE__ */ S(p, {
|
|
57
|
+
placeholder: P.auth.emailPlaceholder,
|
|
58
|
+
variant: O === "transparent" ? "primary" : "secondary",
|
|
72
59
|
required: !0
|
|
73
60
|
}),
|
|
74
|
-
/* @__PURE__ */ S(
|
|
61
|
+
/* @__PURE__ */ S(d, {})
|
|
75
62
|
]
|
|
76
63
|
}),
|
|
77
|
-
/* @__PURE__ */ C(
|
|
64
|
+
/* @__PURE__ */ C(_, {
|
|
78
65
|
minLength: N?.minPasswordLength,
|
|
79
66
|
maxLength: N?.maxPasswordLength,
|
|
80
67
|
name: "password",
|
|
81
68
|
type: "password",
|
|
82
69
|
autoComplete: "current-password",
|
|
83
|
-
isDisabled:
|
|
70
|
+
isDisabled: J,
|
|
84
71
|
value: H,
|
|
85
72
|
onChange: U,
|
|
86
73
|
children: [
|
|
87
|
-
/* @__PURE__ */ S(
|
|
88
|
-
/* @__PURE__ */ S(
|
|
74
|
+
/* @__PURE__ */ S(m, { children: P.auth.password }),
|
|
75
|
+
/* @__PURE__ */ S(p, {
|
|
89
76
|
placeholder: P.auth.passwordPlaceholder,
|
|
90
|
-
variant:
|
|
77
|
+
variant: O === "transparent" ? "primary" : "secondary",
|
|
91
78
|
required: !0
|
|
92
79
|
}),
|
|
93
|
-
/* @__PURE__ */ S(
|
|
80
|
+
/* @__PURE__ */ S(d, {})
|
|
94
81
|
]
|
|
95
82
|
}),
|
|
96
|
-
N?.rememberMe && /* @__PURE__ */ C(
|
|
83
|
+
N?.rememberMe && /* @__PURE__ */ C(l, {
|
|
97
84
|
name: "rememberMe",
|
|
98
|
-
isDisabled:
|
|
99
|
-
variant:
|
|
100
|
-
children: [/* @__PURE__ */ S(
|
|
85
|
+
isDisabled: J,
|
|
86
|
+
variant: O === "transparent" ? "primary" : "secondary",
|
|
87
|
+
children: [/* @__PURE__ */ S(l.Control, { children: /* @__PURE__ */ S(l.Indicator, {}) }), /* @__PURE__ */ S(l.Content, { children: /* @__PURE__ */ S(m, { children: P.auth.rememberMe }) })]
|
|
88
|
+
}),
|
|
89
|
+
Y && /* @__PURE__ */ S("div", {
|
|
90
|
+
className: "flex justify-center",
|
|
91
|
+
children: Y
|
|
101
92
|
}),
|
|
102
93
|
/* @__PURE__ */ C("div", {
|
|
103
94
|
className: "flex flex-col gap-3",
|
|
104
|
-
children: [
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}),
|
|
114
|
-
F && /* @__PURE__ */ S(t, {
|
|
115
|
-
view: "signIn",
|
|
116
|
-
isPending: X
|
|
117
|
-
}),
|
|
118
|
-
I && /* @__PURE__ */ S(n, { isPending: X })
|
|
119
|
-
]
|
|
95
|
+
children: [/* @__PURE__ */ C(s, {
|
|
96
|
+
type: "submit",
|
|
97
|
+
className: "w-full",
|
|
98
|
+
isPending: J,
|
|
99
|
+
children: [K && /* @__PURE__ */ S(g, {
|
|
100
|
+
color: "current",
|
|
101
|
+
size: "sm"
|
|
102
|
+
}), P.auth.signIn]
|
|
103
|
+
}), F.flatMap((e) => e.authButtons?.map((t, n) => /* @__PURE__ */ S(t, { view: "signIn" }, `${e.id}-${n.toString()}`)))]
|
|
120
104
|
})
|
|
121
105
|
]
|
|
122
106
|
}),
|
|
123
|
-
|
|
124
|
-
socialLayout: D,
|
|
125
|
-
isPending: X
|
|
126
|
-
})] })
|
|
107
|
+
D === "bottom" && /* @__PURE__ */ C(x, { children: [X && /* @__PURE__ */ S(e, { children: P.auth.or }), !!L?.length && /* @__PURE__ */ S(t, { socialLayout: E })] })
|
|
127
108
|
]
|
|
128
109
|
}),
|
|
129
|
-
/* @__PURE__ */ C(
|
|
110
|
+
/* @__PURE__ */ C(c.Footer, {
|
|
130
111
|
className: "flex-col gap-3",
|
|
131
|
-
children: [N?.forgotPassword && /* @__PURE__ */ S(
|
|
132
|
-
href: `${j.auth}/${
|
|
112
|
+
children: [N?.forgotPassword && /* @__PURE__ */ S(h, {
|
|
113
|
+
href: `${j.auth}/${R.auth.forgotPassword}`,
|
|
133
114
|
className: "no-underline hover:underline",
|
|
134
115
|
children: P.auth.forgotPasswordLink
|
|
135
|
-
}), N?.enabled && /* @__PURE__ */ C(
|
|
116
|
+
}), N?.enabled && /* @__PURE__ */ C(u, {
|
|
136
117
|
className: "text-sm",
|
|
137
118
|
children: [
|
|
138
119
|
P.auth.needToCreateAnAccount,
|
|
139
120
|
" ",
|
|
140
|
-
/* @__PURE__ */ S(
|
|
141
|
-
href: `${j.auth}/${
|
|
121
|
+
/* @__PURE__ */ S(h, {
|
|
122
|
+
href: `${j.auth}/${R.auth.signUp}`,
|
|
142
123
|
className: "text-accent no-underline hover:underline decoration-accent-hover",
|
|
143
124
|
children: P.auth.signUp
|
|
144
125
|
})
|
|
@@ -149,4 +130,4 @@ function E({ className: E, socialLayout: D, socialPosition: O = "bottom", varian
|
|
|
149
130
|
});
|
|
150
131
|
}
|
|
151
132
|
//#endregion
|
|
152
|
-
export {
|
|
133
|
+
export { T as SignIn };
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { useAuth as e, useSignOut as t } from "@better-auth-ui/react";
|
|
2
2
|
import { Spinner as n, cn as r, toast as i } from "@heroui/react";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { useEffect as a, useRef as o } from "react";
|
|
4
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/auth/sign-out.tsx
|
|
6
6
|
function c({ className: c }) {
|
|
7
|
-
let {
|
|
7
|
+
let { authClient: l, basePaths: u, navigate: d, viewPaths: f } = e(), { mutate: p } = t(l, {
|
|
8
8
|
onError: (e) => {
|
|
9
|
-
i.danger(e.error?.message || e.message),
|
|
10
|
-
to: `${
|
|
9
|
+
i.danger(e.error?.message || e.message), d({
|
|
10
|
+
to: `${u.auth}/${f.auth.signIn}`,
|
|
11
11
|
replace: !0
|
|
12
12
|
});
|
|
13
13
|
},
|
|
14
|
-
onSuccess: () =>
|
|
15
|
-
to: `${
|
|
14
|
+
onSuccess: () => d({
|
|
15
|
+
to: `${u.auth}/${f.auth.signIn}`,
|
|
16
16
|
replace: !0
|
|
17
17
|
})
|
|
18
|
-
}),
|
|
19
|
-
return
|
|
20
|
-
|
|
21
|
-
}, [
|
|
18
|
+
}), m = o(!1);
|
|
19
|
+
return a(() => {
|
|
20
|
+
m.current || (m.current = !0, p());
|
|
21
|
+
}, [p]), /* @__PURE__ */ s(n, {
|
|
22
22
|
className: r("mx-auto my-auto", c),
|
|
23
23
|
color: "current"
|
|
24
24
|
});
|