@better-auth-ui/heroui 1.6.2 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/auth/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-provider.js +12 -11
- 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 +3 -4
- package/dist/components/{settings/security → auth/delete-user}/danger-zone.js +1 -1
- package/dist/components/{settings/security → auth/delete-user}/delete-user.d.ts +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/error-toaster.d.ts +1 -0
- package/dist/components/auth/error-toaster.js +17 -0
- package/dist/components/auth/forgot-password.d.ts +2 -2
- package/dist/components/auth/forgot-password.js +42 -42
- 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/{settings/account → auth/multi-session}/manage-accounts.d.ts +1 -1
- 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/{settings/security → auth/passkey}/passkeys.d.ts +1 -1
- package/dist/components/auth/passkey/passkeys.js +106 -0
- package/dist/components/auth/provider-button.d.ts +13 -0
- package/dist/components/auth/provider-button.js +25 -0
- package/dist/components/auth/provider-buttons.d.ts +3 -10
- package/dist/components/auth/provider-buttons.js +14 -22
- package/dist/components/auth/reset-password.d.ts +1 -1
- package/dist/components/auth/reset-password.js +110 -110
- 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.d.ts +1 -1
- package/dist/components/{settings → auth/settings}/account/change-email.js +17 -20
- package/dist/components/{settings → auth/settings}/account/user-profile.d.ts +3 -4
- 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.d.ts +1 -1
- package/dist/components/auth/settings/security/active-sessions.js +34 -0
- package/dist/components/{settings → auth/settings}/security/change-password.d.ts +1 -1
- 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.d.ts +1 -1
- package/dist/components/auth/settings/security/linked-accounts.js +45 -0
- 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.d.ts +1 -1
- package/dist/components/auth/sign-in.js +64 -100
- package/dist/components/auth/sign-out.js +11 -11
- package/dist/components/auth/sign-up.d.ts +1 -1
- package/dist/components/auth/sign-up.js +123 -157
- 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 +142 -0
- package/dist/components/auth/username/username-field.d.ts +8 -0
- package/dist/components/auth/username/username-field.js +51 -0
- package/dist/email.d.ts +7 -0
- package/dist/email.js +9 -0
- package/dist/index.d.ts +13 -27
- package/dist/index.js +22 -36
- 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 +22 -22
- package/src/components/auth/additional-field.tsx +554 -0
- package/src/components/auth/auth-provider.tsx +8 -5
- package/src/components/auth/auth.tsx +100 -36
- package/src/components/{settings/security → auth/delete-user}/danger-zone.tsx +3 -10
- package/src/components/{settings/security → auth/delete-user}/delete-user.tsx +31 -24
- 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/error-toaster.tsx +25 -0
- package/src/components/auth/forgot-password.tsx +15 -13
- package/src/components/auth/magic-link/magic-link-button.tsx +61 -0
- package/src/components/auth/{magic-link.tsx → magic-link/magic-link.tsx} +52 -57
- package/src/components/{settings/account → auth/multi-session}/manage-account.tsx +15 -15
- package/src/components/{settings/account → auth/multi-session}/manage-accounts.tsx +16 -12
- package/src/components/{user/switch-account-menu.tsx → auth/multi-session/switch-account-submenu-content.tsx} +19 -17
- package/src/components/{user/switch-account-item.tsx → auth/multi-session/switch-account-submenu-item.tsx} +18 -8
- 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 +21 -9
- package/src/components/auth/passkey/passkeys.tsx +196 -0
- package/src/components/auth/provider-button.tsx +65 -0
- package/src/components/auth/provider-buttons.tsx +23 -45
- package/src/components/auth/reset-password.tsx +14 -9
- package/src/components/{settings → auth/settings}/account/account-settings.tsx +15 -13
- package/src/components/{settings → auth/settings}/account/change-avatar.tsx +4 -5
- package/src/components/{settings → auth/settings}/account/change-email.tsx +5 -6
- package/src/components/auth/settings/account/user-profile.tsx +171 -0
- package/src/components/{settings → auth/settings}/security/active-session.tsx +8 -6
- package/src/components/{settings → auth/settings}/security/active-sessions.tsx +5 -10
- package/src/components/{settings → auth/settings}/security/change-password.tsx +22 -14
- package/src/components/{settings → auth/settings}/security/linked-account.tsx +10 -16
- package/src/components/{settings → auth/settings}/security/linked-accounts.tsx +4 -9
- 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 +39 -80
- package/src/components/auth/sign-out.tsx +2 -2
- package/src/components/auth/sign-up.tsx +110 -147
- package/src/components/{settings/account → auth/theme}/appearance.tsx +18 -25
- 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 +283 -0
- package/src/components/auth/username/username-field.tsx +122 -0
- package/src/email.ts +9 -0
- package/src/index.tsx +13 -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 -111
- package/dist/components/auth/passkey-button.d.ts +0 -4
- package/dist/components/auth/passkey-button.js +0 -24
- 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 -51
- package/dist/components/settings/account/manage-accounts.js +0 -33
- package/dist/components/settings/account/user-profile.js +0 -106
- package/dist/components/settings/security/active-session.js +0 -62
- package/dist/components/settings/security/active-sessions.js +0 -34
- package/dist/components/settings/security/change-password.js +0 -192
- package/dist/components/settings/security/delete-user.js +0 -97
- package/dist/components/settings/security/linked-account.js +0 -62
- package/dist/components/settings/security/linked-accounts.js +0 -45
- 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 -36
- package/src/components/settings/account/user-profile.tsx +0 -218
- package/src/components/settings/security/passkeys.tsx +0 -104
- package/src/core.ts +0 -1
- package/src/react-exports.ts +0 -1
- /package/dist/components/{settings/security → auth/passkey}/passkey.d.ts +0 -0
- /package/dist/components/{settings → auth/settings}/account/change-avatar.d.ts +0 -0
- /package/dist/components/{settings → auth/settings}/security/active-session.d.ts +0 -0
- /package/dist/components/{settings → auth/settings}/security/linked-account.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,37 @@
|
|
|
1
|
+
import { UserAvatar as e } from "./user-avatar.js";
|
|
2
|
+
import { useAuth as t, useSession as n } from "@better-auth-ui/react";
|
|
3
|
+
import { Skeleton as r, cn as i } from "@heroui/react";
|
|
4
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/auth/user/user-view.tsx
|
|
6
|
+
function s({ className: s, isPending: c, size: l = "sm", user: u, ...d }) {
|
|
7
|
+
let { authClient: f } = t(), { data: p, isPending: m } = n(f, { enabled: !u && !c }), h = u ?? p?.user;
|
|
8
|
+
return (c || m) && !u ? /* @__PURE__ */ o("div", {
|
|
9
|
+
className: i("flex items-center gap-2 min-w-0", s),
|
|
10
|
+
...d,
|
|
11
|
+
children: [/* @__PURE__ */ a(e, {
|
|
12
|
+
isPending: !0,
|
|
13
|
+
size: l
|
|
14
|
+
}), /* @__PURE__ */ o("div", {
|
|
15
|
+
className: "flex flex-col gap-1 min-w-0",
|
|
16
|
+
children: [/* @__PURE__ */ a(r, { className: "h-3.5 w-24 rounded-lg" }), /* @__PURE__ */ a(r, { className: "h-3 w-32 rounded-lg" })]
|
|
17
|
+
})]
|
|
18
|
+
}) : /* @__PURE__ */ o("div", {
|
|
19
|
+
className: i("flex items-center gap-2 min-w-0", s),
|
|
20
|
+
...d,
|
|
21
|
+
children: [/* @__PURE__ */ a(e, {
|
|
22
|
+
user: h,
|
|
23
|
+
size: l
|
|
24
|
+
}), /* @__PURE__ */ o("div", {
|
|
25
|
+
className: "min-w-0",
|
|
26
|
+
children: [/* @__PURE__ */ a("p", {
|
|
27
|
+
className: "text-sm font-medium truncate leading-tight",
|
|
28
|
+
children: h?.displayUsername || h?.name || h?.email
|
|
29
|
+
}), (h?.displayUsername || h?.name) && /* @__PURE__ */ a("p", {
|
|
30
|
+
className: "text-muted text-xs mb-0.5 truncate overflow-x-hidden",
|
|
31
|
+
children: h?.email
|
|
32
|
+
})]
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { s as UserView };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CardProps } from '@heroui/react';
|
|
2
|
+
import { SocialLayout } from '../provider-buttons';
|
|
3
|
+
export interface SignInUsernameProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
socialLayout?: SocialLayout;
|
|
6
|
+
socialPosition?: "top" | "bottom";
|
|
7
|
+
variant?: CardProps["variant"];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Render the username-based sign-in UI.
|
|
11
|
+
*
|
|
12
|
+
* @returns The sign-in JSX element containing username/password fields, optional magic-link button, and social provider buttons.
|
|
13
|
+
*/
|
|
14
|
+
export declare function SignInUsername({ className, socialLayout, socialPosition, variant, ...props }: SignInUsernameProps & Omit<CardProps, "children">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { FieldSeparator as e } from "../field-separator.js";
|
|
2
|
+
import { ProviderButtons as t } from "../provider-buttons.js";
|
|
3
|
+
import { usernamePlugin as n } from "../../../lib/auth/username-plugin.js";
|
|
4
|
+
import { authMutationKeys as r } from "@better-auth-ui/core";
|
|
5
|
+
import { useAuth as i, useAuthPlugin as a, useSendVerificationEmail as o, useSignInEmail as s, useSignInUsername as c } from "@better-auth-ui/react";
|
|
6
|
+
import { Button as l, Card as u, Checkbox as d, Description as f, FieldError as p, Form as m, Input as h, Label as g, Link as _, Spinner as v, TextField as y, cn as b, toast as x } from "@heroui/react";
|
|
7
|
+
import { useState as S } from "react";
|
|
8
|
+
import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
9
|
+
import { useIsMutating as E } from "@tanstack/react-query";
|
|
10
|
+
//#region src/components/auth/username/sign-in-username.tsx
|
|
11
|
+
function D({ className: D, socialLayout: O, socialPosition: k = "bottom", variant: A, ...j }) {
|
|
12
|
+
let { authClient: M, basePaths: N, baseURL: P, emailAndPassword: F, localization: I, plugins: L, redirectTo: R, socialProviders: z, viewPaths: B, navigate: V } = i(), { localization: H } = a(n), [U, W] = S(""), { mutate: G } = o(M, { onSuccess: () => x.success(I.auth.verificationEmailSent) });
|
|
13
|
+
function K(e) {
|
|
14
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
|
|
15
|
+
}
|
|
16
|
+
let { mutate: q } = s(M, {
|
|
17
|
+
onError: (e, { email: t }) => {
|
|
18
|
+
W(""), e.error?.code === "EMAIL_NOT_VERIFIED" ? x.danger(e.error?.message || e.message, { actionProps: {
|
|
19
|
+
children: I.auth.resend,
|
|
20
|
+
onClick: () => G({
|
|
21
|
+
email: t,
|
|
22
|
+
callbackURL: `${P}${R}`
|
|
23
|
+
})
|
|
24
|
+
} }) : x.danger(e.error?.message || e.message);
|
|
25
|
+
},
|
|
26
|
+
onSuccess: () => V({ to: R })
|
|
27
|
+
}), { mutate: J, isPending: Y } = c(M, {
|
|
28
|
+
onError: (e) => {
|
|
29
|
+
W(""), x.danger(e.error?.message || e.message);
|
|
30
|
+
},
|
|
31
|
+
onSuccess: () => V({ to: R })
|
|
32
|
+
}), X = (e) => {
|
|
33
|
+
e.preventDefault();
|
|
34
|
+
let t = new FormData(e.currentTarget), n = t.get("email"), r = t.get("rememberMe") === "on";
|
|
35
|
+
K(n) ? q({
|
|
36
|
+
email: n,
|
|
37
|
+
password: U,
|
|
38
|
+
...F?.rememberMe ? { rememberMe: r } : {}
|
|
39
|
+
}) : J({
|
|
40
|
+
username: n,
|
|
41
|
+
password: U,
|
|
42
|
+
...F?.rememberMe ? { rememberMe: r } : {}
|
|
43
|
+
});
|
|
44
|
+
}, Z = E({ mutationKey: r.signIn.all }) + E({ mutationKey: r.signUp.all }) > 0, Q = F?.enabled && !!z?.length;
|
|
45
|
+
return /* @__PURE__ */ T(u, {
|
|
46
|
+
className: b("w-full max-w-sm gap-4 md:p-6", D),
|
|
47
|
+
variant: A,
|
|
48
|
+
...j,
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ w(u.Header, { children: /* @__PURE__ */ w(u.Title, {
|
|
51
|
+
className: "text-xl font-semibold mb-1",
|
|
52
|
+
children: I.auth.signIn
|
|
53
|
+
}) }),
|
|
54
|
+
/* @__PURE__ */ T(u.Content, {
|
|
55
|
+
className: "gap-4",
|
|
56
|
+
children: [
|
|
57
|
+
k === "top" && /* @__PURE__ */ T(C, { children: [!!z?.length && /* @__PURE__ */ w(t, { socialLayout: O }), Q && /* @__PURE__ */ w(e, { children: I.auth.or })] }),
|
|
58
|
+
F?.enabled && /* @__PURE__ */ T(m, {
|
|
59
|
+
onSubmit: X,
|
|
60
|
+
className: "flex flex-col gap-4",
|
|
61
|
+
children: [
|
|
62
|
+
/* @__PURE__ */ T(y, {
|
|
63
|
+
name: "email",
|
|
64
|
+
type: "text",
|
|
65
|
+
autoComplete: "username email",
|
|
66
|
+
isDisabled: Z,
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ w(g, { children: H.username }),
|
|
69
|
+
/* @__PURE__ */ w(h, {
|
|
70
|
+
placeholder: H.usernameOrEmailPlaceholder,
|
|
71
|
+
variant: A === "transparent" ? "primary" : "secondary",
|
|
72
|
+
required: !0
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ w(p, {})
|
|
75
|
+
]
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ T(y, {
|
|
78
|
+
minLength: F?.minPasswordLength,
|
|
79
|
+
maxLength: F?.maxPasswordLength,
|
|
80
|
+
name: "password",
|
|
81
|
+
type: "password",
|
|
82
|
+
autoComplete: "current-password",
|
|
83
|
+
isDisabled: Z,
|
|
84
|
+
value: U,
|
|
85
|
+
onChange: W,
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ w(g, { children: I.auth.password }),
|
|
88
|
+
/* @__PURE__ */ w(h, {
|
|
89
|
+
placeholder: I.auth.passwordPlaceholder,
|
|
90
|
+
variant: A === "transparent" ? "primary" : "secondary",
|
|
91
|
+
required: !0
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ w(p, {})
|
|
94
|
+
]
|
|
95
|
+
}),
|
|
96
|
+
F?.rememberMe && /* @__PURE__ */ T(d, {
|
|
97
|
+
name: "rememberMe",
|
|
98
|
+
isDisabled: Z,
|
|
99
|
+
variant: A === "transparent" ? "primary" : "secondary",
|
|
100
|
+
children: [/* @__PURE__ */ w(d.Control, { children: /* @__PURE__ */ w(d.Indicator, {}) }), /* @__PURE__ */ w(d.Content, { children: /* @__PURE__ */ w(g, { children: I.auth.rememberMe }) })]
|
|
101
|
+
}),
|
|
102
|
+
/* @__PURE__ */ T("div", {
|
|
103
|
+
className: "flex flex-col gap-3",
|
|
104
|
+
children: [/* @__PURE__ */ T(l, {
|
|
105
|
+
type: "submit",
|
|
106
|
+
className: "w-full",
|
|
107
|
+
isPending: Y || Z,
|
|
108
|
+
children: [Y && /* @__PURE__ */ w(v, {
|
|
109
|
+
color: "current",
|
|
110
|
+
size: "sm"
|
|
111
|
+
}), I.auth.signIn]
|
|
112
|
+
}), L.flatMap((e) => e.authButtons?.map((t, n) => /* @__PURE__ */ w(t, { view: "signIn" }, `${e.id}-${n.toString()}`)))]
|
|
113
|
+
})
|
|
114
|
+
]
|
|
115
|
+
}),
|
|
116
|
+
k === "bottom" && /* @__PURE__ */ T(C, { children: [Q && /* @__PURE__ */ w(e, { children: I.auth.or }), !!z?.length && /* @__PURE__ */ w(t, { socialLayout: O })] })
|
|
117
|
+
]
|
|
118
|
+
}),
|
|
119
|
+
/* @__PURE__ */ T(u.Footer, {
|
|
120
|
+
className: "flex-col gap-3",
|
|
121
|
+
children: [F?.forgotPassword && /* @__PURE__ */ w(_, {
|
|
122
|
+
href: `${N.auth}/${B.auth.forgotPassword}`,
|
|
123
|
+
className: "no-underline hover:underline",
|
|
124
|
+
children: I.auth.forgotPasswordLink
|
|
125
|
+
}), F?.enabled && /* @__PURE__ */ T(f, {
|
|
126
|
+
className: "text-sm",
|
|
127
|
+
children: [
|
|
128
|
+
I.auth.needToCreateAnAccount,
|
|
129
|
+
" ",
|
|
130
|
+
/* @__PURE__ */ w(_, {
|
|
131
|
+
href: `${N.auth}/${B.auth.signUp}`,
|
|
132
|
+
className: "text-accent no-underline hover:underline decoration-accent-hover",
|
|
133
|
+
children: I.auth.signUp
|
|
134
|
+
})
|
|
135
|
+
]
|
|
136
|
+
})]
|
|
137
|
+
})
|
|
138
|
+
]
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
//#endregion
|
|
142
|
+
export { D as SignInUsername };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AdditionalFieldProps } from '../additional-field';
|
|
2
|
+
/**
|
|
3
|
+
* Renderer for the `username` additional field. Owns availability checking,
|
|
4
|
+
* length limits, and visual indicators. `FieldError` automatically surfaces
|
|
5
|
+
* native validation messages. Availability feedback is shown via the icon and
|
|
6
|
+
* aria-label without affecting the field's invalid state.
|
|
7
|
+
*/
|
|
8
|
+
export declare function UsernameField({ name, field, isPending, variant }: AdditionalFieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { usernamePlugin as e } from "../../../lib/auth/username-plugin.js";
|
|
2
|
+
import { useAuth as t, useAuthPlugin as n, useIsUsernameAvailable as r } from "@better-auth-ui/react";
|
|
3
|
+
import { Check as i, Xmark as a } from "@gravity-ui/icons";
|
|
4
|
+
import { FieldError as o, InputGroup as s, Label as c, Spinner as l, TextField as u } from "@heroui/react";
|
|
5
|
+
import { useState as d } from "react";
|
|
6
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
|
+
import { useDebouncer as m } from "@tanstack/react-pacer";
|
|
8
|
+
//#region src/components/auth/username/username-field.tsx
|
|
9
|
+
function h({ name: h, field: g, isPending: _, variant: v }) {
|
|
10
|
+
let { authClient: y } = t(), { localization: b, minUsernameLength: x, maxUsernameLength: S, isUsernameAvailable: C } = n(e), w = String(g.defaultValue ?? ""), [T, E] = d(w), { mutate: D, data: O, error: k, reset: A } = r(y, { onError: () => {} }), j = m((e) => {
|
|
11
|
+
let t = e.trim();
|
|
12
|
+
if (!t || t === w) {
|
|
13
|
+
A();
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
D({ username: t });
|
|
17
|
+
}, { wait: 500 });
|
|
18
|
+
function M(e) {
|
|
19
|
+
E(e), A(), C && j.maybeExecute(e);
|
|
20
|
+
}
|
|
21
|
+
let N = !!C && !!T.trim() && T.trim() !== w;
|
|
22
|
+
return /* @__PURE__ */ p(u, {
|
|
23
|
+
name: h,
|
|
24
|
+
type: "text",
|
|
25
|
+
autoComplete: "username",
|
|
26
|
+
minLength: x,
|
|
27
|
+
maxLength: S,
|
|
28
|
+
isDisabled: _,
|
|
29
|
+
isRequired: g.required,
|
|
30
|
+
isReadOnly: g.readOnly,
|
|
31
|
+
value: T,
|
|
32
|
+
onChange: M,
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ f(c, { children: g.label }),
|
|
35
|
+
/* @__PURE__ */ p(s, {
|
|
36
|
+
variant: v === "transparent" ? "primary" : "secondary",
|
|
37
|
+
children: [/* @__PURE__ */ f(s.Input, { placeholder: g.placeholder }), N && /* @__PURE__ */ f(s.Suffix, {
|
|
38
|
+
"aria-label": O?.available ? b.usernameAvailable : O?.available === !1 ? b.usernameTaken : void 0,
|
|
39
|
+
className: "px-2",
|
|
40
|
+
children: O?.available ? /* @__PURE__ */ f(i, { className: "text-success" }) : k || O?.available === !1 ? /* @__PURE__ */ f(a, { className: "text-danger" }) : /* @__PURE__ */ f(l, {
|
|
41
|
+
size: "sm",
|
|
42
|
+
color: "current"
|
|
43
|
+
})
|
|
44
|
+
})]
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ f(o, {})
|
|
47
|
+
]
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { h as UsernameField };
|
package/dist/email.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './components/auth/email/email-changed-email';
|
|
2
|
+
export * from './components/auth/email/email-verification-email';
|
|
3
|
+
export * from './components/auth/email/magic-link-email';
|
|
4
|
+
export * from './components/auth/email/new-device-email';
|
|
5
|
+
export * from './components/auth/email/otp-email';
|
|
6
|
+
export * from './components/auth/email/password-changed-email';
|
|
7
|
+
export * from './components/auth/email/reset-password-email';
|
package/dist/email.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { EmailChangedEmail as e } from "./components/auth/email/email-changed-email.js";
|
|
3
|
+
import { EmailVerificationEmail as t } from "./components/auth/email/email-verification-email.js";
|
|
4
|
+
import { MagicLinkEmail as n } from "./components/auth/email/magic-link-email.js";
|
|
5
|
+
import { NewDeviceEmail as r } from "./components/auth/email/new-device-email.js";
|
|
6
|
+
import { OtpEmail as i } from "./components/auth/email/otp-email.js";
|
|
7
|
+
import { PasswordChangedEmail as a } from "./components/auth/email/password-changed-email.js";
|
|
8
|
+
import { ResetPasswordEmail as o } from "./components/auth/email/reset-password-email.js";
|
|
9
|
+
export { e as EmailChangedEmail, t as EmailVerificationEmail, n as MagicLinkEmail, r as NewDeviceEmail, i as OtpEmail, a as PasswordChangedEmail, o as ResetPasswordEmail };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,35 +1,21 @@
|
|
|
1
|
+
export * from './components/auth/additional-field';
|
|
1
2
|
export * from './components/auth/auth';
|
|
2
3
|
export * from './components/auth/auth-provider';
|
|
3
4
|
export * from './components/auth/forgot-password';
|
|
4
|
-
export * from './components/auth/
|
|
5
|
-
export * from './components/auth/magic-link-button';
|
|
6
|
-
export * from './components/auth/passkey-button';
|
|
5
|
+
export * from './components/auth/provider-button';
|
|
7
6
|
export * from './components/auth/provider-buttons';
|
|
8
7
|
export * from './components/auth/reset-password';
|
|
8
|
+
export * from './components/auth/settings/account/account-settings';
|
|
9
|
+
export * from './components/auth/settings/account/change-email';
|
|
10
|
+
export * from './components/auth/settings/account/user-profile';
|
|
11
|
+
export * from './components/auth/settings/security/active-sessions';
|
|
12
|
+
export * from './components/auth/settings/security/change-password';
|
|
13
|
+
export * from './components/auth/settings/security/linked-accounts';
|
|
14
|
+
export * from './components/auth/settings/security/security-settings';
|
|
15
|
+
export * from './components/auth/settings/settings';
|
|
9
16
|
export * from './components/auth/sign-in';
|
|
10
17
|
export * from './components/auth/sign-out';
|
|
11
18
|
export * from './components/auth/sign-up';
|
|
12
|
-
export * from './components/
|
|
13
|
-
export * from './components/
|
|
14
|
-
export * from './components/
|
|
15
|
-
export * from './components/email/new-device-email';
|
|
16
|
-
export * from './components/email/otp-email';
|
|
17
|
-
export * from './components/email/password-changed-email';
|
|
18
|
-
export * from './components/email/reset-password-email';
|
|
19
|
-
export * from './components/settings/account/account-settings';
|
|
20
|
-
export * from './components/settings/account/appearance';
|
|
21
|
-
export * from './components/settings/account/change-email';
|
|
22
|
-
export * from './components/settings/account/manage-account';
|
|
23
|
-
export * from './components/settings/account/manage-accounts';
|
|
24
|
-
export * from './components/settings/account/user-profile';
|
|
25
|
-
export * from './components/settings/security/active-sessions';
|
|
26
|
-
export * from './components/settings/security/change-password';
|
|
27
|
-
export * from './components/settings/security/danger-zone';
|
|
28
|
-
export * from './components/settings/security/delete-user';
|
|
29
|
-
export * from './components/settings/security/linked-accounts';
|
|
30
|
-
export * from './components/settings/security/passkeys';
|
|
31
|
-
export * from './components/settings/security/security-settings';
|
|
32
|
-
export * from './components/settings/settings';
|
|
33
|
-
export * from './components/user/user-avatar';
|
|
34
|
-
export * from './components/user/user-button';
|
|
35
|
-
export * from './components/user/user-view';
|
|
19
|
+
export * from './components/auth/user/user-avatar';
|
|
20
|
+
export * from './components/auth/user/user-button';
|
|
21
|
+
export * from './components/auth/user/user-view';
|
package/dist/index.js
CHANGED
|
@@ -1,37 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
24
|
-
import { ManageAccount as S } from "./components/settings/account/manage-account.js";
|
|
25
|
-
import { ManageAccounts as C } from "./components/settings/account/manage-accounts.js";
|
|
26
|
-
import { UserProfile as w } from "./components/settings/account/user-profile.js";
|
|
27
|
-
import { AccountSettings as T } from "./components/settings/account/account-settings.js";
|
|
28
|
-
import { ActiveSessions as E } from "./components/settings/security/active-sessions.js";
|
|
29
|
-
import { ChangePassword as D } from "./components/settings/security/change-password.js";
|
|
30
|
-
import { DeleteUser as O } from "./components/settings/security/delete-user.js";
|
|
31
|
-
import { DangerZone as k } from "./components/settings/security/danger-zone.js";
|
|
32
|
-
import { LinkedAccounts as A } from "./components/settings/security/linked-accounts.js";
|
|
33
|
-
import { Passkeys as j } from "./components/settings/security/passkeys.js";
|
|
34
|
-
import { SecuritySettings as M } from "./components/settings/security/security-settings.js";
|
|
35
|
-
import { Settings as N } from "./components/settings/settings.js";
|
|
36
|
-
import { UserButton as P } from "./components/user/user-button.js";
|
|
37
|
-
export { T as AccountSettings, E as ActiveSessions, v as Appearance, l as Auth, u as AuthProvider, y as ChangeEmail, D as ChangePassword, k as DangerZone, O as DeleteUser, d as EmailChangedEmail, f as EmailVerificationEmail, e as ForgotPassword, A as LinkedAccounts, i as MagicLink, t as MagicLinkButton, p as MagicLinkEmail, S as ManageAccount, C as ManageAccounts, m as NewDeviceEmail, h as OtpEmail, n as PasskeyButton, j as Passkeys, g as PasswordChangedEmail, r as ProviderButtons, a as ResetPassword, _ as ResetPasswordEmail, M as SecuritySettings, N as Settings, o as SignIn, s as SignOut, c as SignUp, b as UserAvatar, P as UserButton, w as UserProfile, x as UserView };
|
|
2
|
+
import { AdditionalField as e } from "./components/auth/additional-field.js";
|
|
3
|
+
import { ForgotPassword as t } from "./components/auth/forgot-password.js";
|
|
4
|
+
import { ResetPassword as n } from "./components/auth/reset-password.js";
|
|
5
|
+
import { ProviderButton as r } from "./components/auth/provider-button.js";
|
|
6
|
+
import { ProviderButtons as i } from "./components/auth/provider-buttons.js";
|
|
7
|
+
import { SignIn as a } from "./components/auth/sign-in.js";
|
|
8
|
+
import { SignOut as o } from "./components/auth/sign-out.js";
|
|
9
|
+
import { SignUp as s } from "./components/auth/sign-up.js";
|
|
10
|
+
import { Auth as c } from "./components/auth/auth.js";
|
|
11
|
+
import { AuthProvider as l } from "./components/auth/auth-provider.js";
|
|
12
|
+
import { ChangeEmail as u } from "./components/auth/settings/account/change-email.js";
|
|
13
|
+
import { UserAvatar as d } from "./components/auth/user/user-avatar.js";
|
|
14
|
+
import { UserProfile as f } from "./components/auth/settings/account/user-profile.js";
|
|
15
|
+
import { AccountSettings as p } from "./components/auth/settings/account/account-settings.js";
|
|
16
|
+
import { ActiveSessions as m } from "./components/auth/settings/security/active-sessions.js";
|
|
17
|
+
import { ChangePassword as h } from "./components/auth/settings/security/change-password.js";
|
|
18
|
+
import { LinkedAccounts as g } from "./components/auth/settings/security/linked-accounts.js";
|
|
19
|
+
import { SecuritySettings as _ } from "./components/auth/settings/security/security-settings.js";
|
|
20
|
+
import { Settings as v } from "./components/auth/settings/settings.js";
|
|
21
|
+
import { UserView as y } from "./components/auth/user/user-view.js";
|
|
22
|
+
import { UserButton as b } from "./components/auth/user/user-button.js";
|
|
23
|
+
export { p as AccountSettings, m as ActiveSessions, e as AdditionalField, c as Auth, l as AuthProvider, u as ChangeEmail, h as ChangePassword, t as ForgotPassword, g as LinkedAccounts, r as ProviderButton, i as ProviderButtons, n as ResetPassword, _ as SecuritySettings, v as Settings, a as SignIn, o as SignOut, s as SignUp, d as UserAvatar, b as UserButton, f as UserProfile, y as UserView };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { AdditionalField as AdditionalFieldConfig } from '@better-auth-ui/core';
|
|
2
|
+
import { AccountCardProps, AuthPlugin as AuthPluginPrimitive, AuthPluginComponents as BaseAuthPluginComponents, SecurityCardProps, UserMenuItemProps } from '@better-auth-ui/react';
|
|
3
|
+
import { CardProps } from '@heroui/react';
|
|
4
|
+
import { ComponentType, ReactNode } from 'react';
|
|
5
|
+
import { SocialLayout } from '../../components/auth/provider-buttons';
|
|
6
|
+
/** Props for the heroui `<AdditionalField>` component and `field.render` callbacks. */
|
|
7
|
+
export type AdditionalFieldProps = {
|
|
8
|
+
name: string;
|
|
9
|
+
field: AdditionalFieldConfig;
|
|
10
|
+
isPending?: boolean;
|
|
11
|
+
variant?: CardProps["variant"];
|
|
12
|
+
};
|
|
13
|
+
declare module "@better-auth-ui/core" {
|
|
14
|
+
interface AuthPluginRegister {
|
|
15
|
+
heroui: AuthPlugin;
|
|
16
|
+
}
|
|
17
|
+
interface AdditionalFieldRegister {
|
|
18
|
+
label: ReactNode;
|
|
19
|
+
renderProps: AdditionalFieldProps;
|
|
20
|
+
renderResult: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/** Heroui slot component shapes — inherits from the framework-agnostic defaults and narrows slots that receive a heroui variant from the host. */
|
|
24
|
+
export type AuthPluginComponents = Omit<BaseAuthPluginComponents, "securityCards" | "accountCards"> & {
|
|
25
|
+
/** Rendered as cards inside security settings */
|
|
26
|
+
securityCards?: ComponentType<SecurityCardProps & {
|
|
27
|
+
variant?: CardProps["variant"];
|
|
28
|
+
}>[];
|
|
29
|
+
/** Rendered as cards inside account settings */
|
|
30
|
+
accountCards?: ComponentType<AccountCardProps & {
|
|
31
|
+
variant?: CardProps["variant"];
|
|
32
|
+
}>[];
|
|
33
|
+
/** Rendered as items inside the `UserButton` dropdown (e.g. account switcher). */
|
|
34
|
+
userMenuItems?: ComponentType<UserMenuItemProps>[];
|
|
35
|
+
};
|
|
36
|
+
/** Props the heroui `<Auth>` router spreads onto plugin-contributed auth views. */
|
|
37
|
+
export type AuthViewProps = Omit<CardProps, "children"> & {
|
|
38
|
+
socialLayout?: SocialLayout;
|
|
39
|
+
socialPosition?: "top" | "bottom";
|
|
40
|
+
};
|
|
41
|
+
/** Props the heroui `<Settings>` router spreads onto plugin-contributed settings views. */
|
|
42
|
+
export type SettingsViewProps = Omit<CardProps, "children">;
|
|
43
|
+
/** Heroui plugin type. Plugin authors import this from `@better-auth-ui/heroui`. */
|
|
44
|
+
export type AuthPlugin = AuthPluginPrimitive<AuthPluginComponents, AuthViewProps, SettingsViewProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { DeleteUserPluginOptions } from '@better-auth-ui/core/plugins';
|
|
2
|
+
import { DangerZone } from '../../components/auth/delete-user/danger-zone';
|
|
3
|
+
export declare const deleteUserPlugin: ((options?: DeleteUserPluginOptions | undefined) => Omit<{
|
|
4
|
+
securityCards: (typeof DangerZone)[];
|
|
5
|
+
localization: {
|
|
6
|
+
deleteUser: string;
|
|
7
|
+
deleteUserDescription: string;
|
|
8
|
+
deleteUserVerificationSent: string;
|
|
9
|
+
deleteUserSuccess: string;
|
|
10
|
+
};
|
|
11
|
+
sendDeleteAccountVerification: boolean;
|
|
12
|
+
id: "deleteUser";
|
|
13
|
+
}, "id"> & {
|
|
14
|
+
id: "deleteUser";
|
|
15
|
+
}) & {
|
|
16
|
+
id: "deleteUser";
|
|
17
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DangerZone as e } from "../../components/auth/delete-user/danger-zone.js";
|
|
2
|
+
import { createAuthPlugin as t } from "@better-auth-ui/core";
|
|
3
|
+
import { deleteUserPlugin as n } from "@better-auth-ui/core/plugins";
|
|
4
|
+
//#region src/lib/auth/delete-user-plugin.ts
|
|
5
|
+
var r = t(n.id, (t = {}) => ({
|
|
6
|
+
...n(t),
|
|
7
|
+
securityCards: [e]
|
|
8
|
+
}));
|
|
9
|
+
//#endregion
|
|
10
|
+
export { r as deleteUserPlugin };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { MagicLinkPluginOptions } from '@better-auth-ui/core/plugins';
|
|
2
|
+
import { MagicLink } from '../../components/auth/magic-link/magic-link';
|
|
3
|
+
import { MagicLinkButton } from '../../components/auth/magic-link/magic-link-button';
|
|
4
|
+
export declare const magicLinkPlugin: ((options?: MagicLinkPluginOptions | undefined) => Omit<{
|
|
5
|
+
authButtons: (typeof MagicLinkButton)[];
|
|
6
|
+
views: {
|
|
7
|
+
auth: {
|
|
8
|
+
magicLink: typeof MagicLink;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
fallbackViews: {
|
|
12
|
+
auth: {
|
|
13
|
+
signIn: typeof MagicLink;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
localization: {
|
|
17
|
+
magicLink: string;
|
|
18
|
+
sendMagicLink: string;
|
|
19
|
+
magicLinkSent: string;
|
|
20
|
+
};
|
|
21
|
+
viewPaths: {
|
|
22
|
+
auth: {
|
|
23
|
+
magicLink: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
id: "magicLink";
|
|
27
|
+
}, "id"> & {
|
|
28
|
+
id: "magicLink";
|
|
29
|
+
}) & {
|
|
30
|
+
id: "magicLink";
|
|
31
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MagicLinkButton as e } from "../../components/auth/magic-link/magic-link-button.js";
|
|
2
|
+
import { MagicLink as t } from "../../components/auth/magic-link/magic-link.js";
|
|
3
|
+
import { createAuthPlugin as n } from "@better-auth-ui/core";
|
|
4
|
+
import { magicLinkPlugin as r } from "@better-auth-ui/core/plugins";
|
|
5
|
+
//#region src/lib/auth/magic-link-plugin.ts
|
|
6
|
+
var i = n(r.id, (n = {}) => ({
|
|
7
|
+
...r(n),
|
|
8
|
+
authButtons: [e],
|
|
9
|
+
views: { auth: { magicLink: t } },
|
|
10
|
+
fallbackViews: { auth: { signIn: t } }
|
|
11
|
+
}));
|
|
12
|
+
//#endregion
|
|
13
|
+
export { i as magicLinkPlugin };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MultiSessionPluginOptions } from '@better-auth-ui/core/plugins';
|
|
2
|
+
import { ManageAccounts } from '../../components/auth/multi-session/manage-accounts';
|
|
3
|
+
import { SwitchAccountSubmenu } from '../../components/auth/multi-session/switch-account-submenu';
|
|
4
|
+
export declare const multiSessionPlugin: ((options?: MultiSessionPluginOptions | undefined) => Omit<{
|
|
5
|
+
accountCards: (typeof ManageAccounts)[];
|
|
6
|
+
userMenuItems: (typeof SwitchAccountSubmenu)[];
|
|
7
|
+
localization: {
|
|
8
|
+
switchAccount: string;
|
|
9
|
+
addAccount: string;
|
|
10
|
+
manageAccounts: string;
|
|
11
|
+
manageAccountsDescription: string;
|
|
12
|
+
};
|
|
13
|
+
id: "multiSession";
|
|
14
|
+
}, "id"> & {
|
|
15
|
+
id: "multiSession";
|
|
16
|
+
}) & {
|
|
17
|
+
id: "multiSession";
|
|
18
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ManageAccounts as e } from "../../components/auth/multi-session/manage-accounts.js";
|
|
2
|
+
import { SwitchAccountSubmenu as t } from "../../components/auth/multi-session/switch-account-submenu.js";
|
|
3
|
+
import { createAuthPlugin as n } from "@better-auth-ui/core";
|
|
4
|
+
import { multiSessionPlugin as r } from "@better-auth-ui/core/plugins";
|
|
5
|
+
//#region src/lib/auth/multi-session-plugin.ts
|
|
6
|
+
var i = n(r.id, (n = {}) => ({
|
|
7
|
+
...r(n),
|
|
8
|
+
accountCards: [e],
|
|
9
|
+
userMenuItems: [t]
|
|
10
|
+
}));
|
|
11
|
+
//#endregion
|
|
12
|
+
export { i as multiSessionPlugin };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PasskeyPluginOptions } from '@better-auth-ui/core/plugins';
|
|
2
|
+
import { PasskeyButton } from '../../components/auth/passkey/passkey-button';
|
|
3
|
+
import { Passkeys } from '../../components/auth/passkey/passkeys';
|
|
4
|
+
export declare const passkeyPlugin: ((options?: PasskeyPluginOptions | undefined) => Omit<{
|
|
5
|
+
authButtons: (typeof PasskeyButton)[];
|
|
6
|
+
securityCards: (typeof Passkeys)[];
|
|
7
|
+
localization: {
|
|
8
|
+
passkey: string;
|
|
9
|
+
addPasskey: string;
|
|
10
|
+
deletePasskey: string;
|
|
11
|
+
passkeys: string;
|
|
12
|
+
passkeysDescription: string;
|
|
13
|
+
passkeysInstructions: string;
|
|
14
|
+
};
|
|
15
|
+
id: "passkey";
|
|
16
|
+
}, "id"> & {
|
|
17
|
+
id: "passkey";
|
|
18
|
+
}) & {
|
|
19
|
+
id: "passkey";
|
|
20
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PasskeyButton as e } from "../../components/auth/passkey/passkey-button.js";
|
|
2
|
+
import { Passkeys as t } from "../../components/auth/passkey/passkeys.js";
|
|
3
|
+
import { createAuthPlugin as n } from "@better-auth-ui/core";
|
|
4
|
+
import { passkeyPlugin as r } from "@better-auth-ui/core/plugins";
|
|
5
|
+
//#region src/lib/auth/passkey-plugin.ts
|
|
6
|
+
var i = n(r.id, (n = {}) => ({
|
|
7
|
+
...r(n),
|
|
8
|
+
authButtons: [e],
|
|
9
|
+
securityCards: [t]
|
|
10
|
+
}));
|
|
11
|
+
//#endregion
|
|
12
|
+
export { i as passkeyPlugin };
|