@better-auth-ui/react 1.6.9 → 1.6.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/auth/auth-context.d.ts +2 -2
- package/dist/components/auth/auth-provider.d.ts +4 -4
- package/dist/components/auth/email/email-changed.d.ts +2 -2
- package/dist/components/auth/email/email-verification.d.ts +2 -2
- package/dist/components/auth/email/index.d.ts +10 -10
- package/dist/components/auth/email/magic-link.d.ts +2 -2
- package/dist/components/auth/email/new-device.d.ts +2 -2
- package/dist/components/auth/email/organization-invitation.d.ts +2 -2
- package/dist/components/auth/email/otp-email.d.ts +2 -2
- package/dist/components/auth/email/password-changed.d.ts +2 -2
- package/dist/components/auth/email/reset-password.d.ts +2 -2
- package/dist/components/auth/fetch-options-provider.d.ts +1 -1
- package/dist/components/icons/apple.d.ts +1 -1
- package/dist/components/icons/atlassian.d.ts +1 -1
- package/dist/components/icons/cognito.d.ts +1 -1
- package/dist/components/icons/discord.d.ts +1 -1
- package/dist/components/icons/dropbox.d.ts +1 -1
- package/dist/components/icons/facebook.d.ts +1 -1
- package/dist/components/icons/figma.d.ts +1 -1
- package/dist/components/icons/github.d.ts +1 -1
- package/dist/components/icons/gitlab.d.ts +1 -1
- package/dist/components/icons/google.d.ts +1 -1
- package/dist/components/icons/huggingface.d.ts +1 -1
- package/dist/components/icons/index.d.ts +35 -35
- package/dist/components/icons/kakao.d.ts +1 -1
- package/dist/components/icons/kick.d.ts +1 -1
- package/dist/components/icons/line.d.ts +1 -1
- package/dist/components/icons/linear.d.ts +1 -1
- package/dist/components/icons/linkedin.d.ts +1 -1
- package/dist/components/icons/microsoft.d.ts +1 -1
- package/dist/components/icons/naver.d.ts +1 -1
- package/dist/components/icons/notion.d.ts +1 -1
- package/dist/components/icons/paybin.d.ts +1 -1
- package/dist/components/icons/paypal.d.ts +1 -1
- package/dist/components/icons/polar.d.ts +1 -1
- package/dist/components/icons/railway.d.ts +1 -1
- package/dist/components/icons/reddit.d.ts +1 -1
- package/dist/components/icons/roblox.d.ts +1 -1
- package/dist/components/icons/salesforce.d.ts +1 -1
- package/dist/components/icons/slack.d.ts +1 -1
- package/dist/components/icons/spotify.d.ts +1 -1
- package/dist/components/icons/tiktok.d.ts +1 -1
- package/dist/components/icons/twitch.d.ts +1 -1
- package/dist/components/icons/vercel.d.ts +1 -1
- package/dist/components/icons/vk.d.ts +1 -1
- package/dist/components/icons/wechat.d.ts +1 -1
- package/dist/components/icons/x.d.ts +1 -1
- package/dist/components/icons/zoom.d.ts +1 -1
- package/dist/email.d.ts +1 -1
- package/dist/email.js +1348 -1
- package/dist/hooks/auth/use-authenticate.d.ts +3 -3
- package/dist/hooks/auth/use-user.d.ts +34 -34
- package/dist/hooks/use-auth-mutation.d.ts +4 -4
- package/dist/hooks/use-auth-plugin.d.ts +1 -1
- package/dist/hooks/use-auth-query.d.ts +3 -3
- package/dist/index.d.ts +48 -48
- package/dist/index.js +2469 -47
- package/dist/lib/auth-client.d.ts +4 -4
- package/dist/lib/auth-plugin.d.ts +4 -4
- package/dist/lib/auth-server.d.ts +4 -4
- package/dist/lib/provider-icons.d.ts +2 -2
- package/dist/lib/settings-tab.d.ts +2 -2
- package/dist/lib/utils.d.ts +1 -1
- package/dist/mutations/api-key/create-api-key-mutation.d.ts +5 -5
- package/dist/mutations/api-key/delete-api-key-mutation.d.ts +5 -5
- package/dist/mutations/auth/request-password-reset-mutation.d.ts +4 -4
- package/dist/mutations/auth/reset-password-mutation.d.ts +4 -4
- package/dist/mutations/auth/send-verification-email-mutation.d.ts +4 -4
- package/dist/mutations/auth/sign-in-email-mutation.d.ts +7 -7
- package/dist/mutations/auth/sign-in-social-mutation.d.ts +6 -6
- package/dist/mutations/auth/sign-out-mutation.d.ts +5 -5
- package/dist/mutations/auth/sign-up-email-mutation.d.ts +9 -9
- package/dist/mutations/auth-mutation-options.d.ts +2 -2
- package/dist/mutations/magic-link/sign-in-magic-link-mutation.d.ts +4 -4
- package/dist/mutations/multi-session/revoke-multi-session-mutation.d.ts +5 -5
- package/dist/mutations/multi-session/set-active-session-mutation.d.ts +5 -5
- package/dist/mutations/organization/accept-invitation-mutation.d.ts +7 -7
- package/dist/mutations/organization/cancel-invitation-mutation.d.ts +7 -7
- package/dist/mutations/organization/check-slug-mutation.d.ts +4 -4
- package/dist/mutations/organization/create-organization-mutation.d.ts +5 -5
- package/dist/mutations/organization/delete-organization-mutation.d.ts +5 -5
- package/dist/mutations/organization/index.d.ts +12 -12
- package/dist/mutations/organization/invite-member-mutation.d.ts +9 -9
- package/dist/mutations/organization/leave-organization-mutation.d.ts +5 -5
- package/dist/mutations/organization/reject-invitation-mutation.d.ts +7 -7
- package/dist/mutations/organization/remove-member-mutation.d.ts +5 -5
- package/dist/mutations/organization/set-active-organization-mutation.d.ts +7 -7
- package/dist/mutations/organization/update-member-role-mutation.d.ts +5 -5
- package/dist/mutations/organization/update-organization-mutation.d.ts +5 -5
- package/dist/mutations/passkey/add-passkey-mutation.d.ts +13 -13
- package/dist/mutations/passkey/delete-passkey-mutation.d.ts +5 -5
- package/dist/mutations/passkey/sign-in-passkey-mutation.d.ts +21 -21
- package/dist/mutations/settings/change-email-mutation.d.ts +5 -5
- package/dist/mutations/settings/change-password-mutation.d.ts +6 -6
- package/dist/mutations/settings/delete-user-mutation.d.ts +4 -4
- package/dist/mutations/settings/link-social-mutation.d.ts +4 -4
- package/dist/mutations/settings/revoke-session-mutation.d.ts +5 -5
- package/dist/mutations/settings/unlink-account-mutation.d.ts +5 -5
- package/dist/mutations/settings/update-user-mutation.d.ts +5 -5
- package/dist/mutations/username/is-username-available-mutation.d.ts +4 -4
- package/dist/mutations/username/sign-in-username-mutation.d.ts +7 -7
- package/dist/plugins/captcha-plugin.d.ts +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +27 -1
- package/dist/queries/api-key/list-api-keys-query.d.ts +6 -6
- package/dist/queries/auth/session-query.d.ts +6 -6
- package/dist/queries/auth-query-options.d.ts +2 -2
- package/dist/queries/multi-session/list-device-sessions-query.d.ts +6 -6
- package/dist/queries/organization/active-organization-query.d.ts +8 -8
- package/dist/queries/organization/full-organization-query.d.ts +6 -6
- package/dist/queries/organization/has-permission-query.d.ts +6 -6
- package/dist/queries/organization/index.d.ts +7 -7
- package/dist/queries/organization/list-invitations-query.d.ts +6 -6
- package/dist/queries/organization/list-members-query.d.ts +6 -6
- package/dist/queries/organization/list-organizations-query.d.ts +6 -6
- package/dist/queries/organization/list-user-invitations-query.d.ts +6 -6
- package/dist/queries/passkey/list-passkeys-query.d.ts +6 -6
- package/dist/queries/settings/account-info-query.d.ts +6 -6
- package/dist/queries/settings/list-accounts-query.d.ts +6 -6
- package/dist/queries/settings/list-sessions-query.d.ts +6 -6
- package/dist/server/queries/api-key/list-api-keys-query.d.ts +5 -5
- package/dist/server/queries/auth/session-query.d.ts +5 -5
- package/dist/server/queries/multi-session/list-device-sessions-query.d.ts +5 -5
- package/dist/server/queries/organization/active-organization-query.d.ts +7 -7
- package/dist/server/queries/organization/full-organization-query.d.ts +5 -5
- package/dist/server/queries/organization/has-permission-query.d.ts +5 -5
- package/dist/server/queries/organization/list-invitations-query.d.ts +5 -5
- package/dist/server/queries/organization/list-members-query.d.ts +5 -5
- package/dist/server/queries/organization/list-organizations-query.d.ts +5 -5
- package/dist/server/queries/organization/list-user-invitations-query.d.ts +5 -5
- package/dist/server/queries/passkey/list-passkeys-query.d.ts +5 -5
- package/dist/server/queries/settings/account-info-query.d.ts +5 -5
- package/dist/server/queries/settings/list-accounts-query.d.ts +5 -5
- package/dist/server/queries/settings/list-sessions-query.d.ts +5 -5
- package/dist/server.d.ts +15 -15
- package/dist/server.js +131 -14
- package/dist/use-auth-plugin-ClcP84Uz.js +80 -0
- package/package.json +2 -2
- package/dist/components/auth/auth-context.js +0 -4
- package/dist/components/auth/auth-provider.js +0 -68
- package/dist/components/auth/email/email-changed.js +0 -70
- package/dist/components/auth/email/email-localization.js +0 -26
- package/dist/components/auth/email/email-styles.js +0 -129
- package/dist/components/auth/email/email-verification.js +0 -75
- package/dist/components/auth/email/index.js +0 -10
- package/dist/components/auth/email/magic-link.js +0 -72
- package/dist/components/auth/email/new-device.js +0 -90
- package/dist/components/auth/email/organization-invitation.js +0 -110
- package/dist/components/auth/email/otp-email.js +0 -65
- package/dist/components/auth/email/password-changed.js +0 -76
- package/dist/components/auth/email/reset-password.js +0 -68
- package/dist/components/auth/fetch-options-provider.js +0 -31
- package/dist/components/icons/apple.js +0 -10
- package/dist/components/icons/atlassian.js +0 -14
- package/dist/components/icons/cognito.js +0 -10
- package/dist/components/icons/discord.js +0 -10
- package/dist/components/icons/dropbox.js +0 -10
- package/dist/components/icons/facebook.js +0 -12
- package/dist/components/icons/figma.js +0 -13
- package/dist/components/icons/github.js +0 -12
- package/dist/components/icons/gitlab.js +0 -10
- package/dist/components/icons/google.js +0 -10
- package/dist/components/icons/huggingface.js +0 -10
- package/dist/components/icons/index.js +0 -35
- package/dist/components/icons/kakao.js +0 -12
- package/dist/components/icons/kick.js +0 -12
- package/dist/components/icons/line.js +0 -10
- package/dist/components/icons/linear.js +0 -10
- package/dist/components/icons/linkedin.js +0 -10
- package/dist/components/icons/microsoft.js +0 -10
- package/dist/components/icons/naver.js +0 -10
- package/dist/components/icons/notion.js +0 -10
- package/dist/components/icons/paybin.js +0 -9
- package/dist/components/icons/paypal.js +0 -10
- package/dist/components/icons/polar.js +0 -10
- package/dist/components/icons/railway.js +0 -10
- package/dist/components/icons/reddit.js +0 -10
- package/dist/components/icons/roblox.js +0 -13
- package/dist/components/icons/salesforce.js +0 -10
- package/dist/components/icons/slack.js +0 -10
- package/dist/components/icons/spotify.js +0 -10
- package/dist/components/icons/tiktok.js +0 -11
- package/dist/components/icons/twitch.js +0 -13
- package/dist/components/icons/vercel.js +0 -10
- package/dist/components/icons/vk.js +0 -10
- package/dist/components/icons/wechat.js +0 -10
- package/dist/components/icons/x.js +0 -10
- package/dist/components/icons/zoom.js +0 -12
- package/dist/components/mutation-invalidator.js +0 -31
- package/dist/components/settings/account/theme-preview.js +0 -10
- package/dist/hooks/auth/use-authenticate.js +0 -29
- package/dist/hooks/auth/use-user.js +0 -15
- package/dist/hooks/use-auth-mutation.js +0 -19
- package/dist/hooks/use-auth-plugin.js +0 -28
- package/dist/hooks/use-auth-query.js +0 -21
- package/dist/lib/auth-client.js +0 -1
- package/dist/lib/auth-plugin.js +0 -1
- package/dist/lib/auth-server.js +0 -1
- package/dist/lib/provider-icons.js +0 -48
- package/dist/lib/settings-tab.js +0 -1
- package/dist/lib/utils.js +0 -5
- package/dist/mutations/api-key/create-api-key-mutation.js +0 -39
- package/dist/mutations/api-key/delete-api-key-mutation.js +0 -39
- package/dist/mutations/auth/request-password-reset-mutation.js +0 -33
- package/dist/mutations/auth/reset-password-mutation.js +0 -34
- package/dist/mutations/auth/send-verification-email-mutation.js +0 -33
- package/dist/mutations/auth/sign-in-email-mutation.js +0 -40
- package/dist/mutations/auth/sign-in-social-mutation.js +0 -38
- package/dist/mutations/auth/sign-out-mutation.js +0 -41
- package/dist/mutations/auth/sign-up-email-mutation.js +0 -36
- package/dist/mutations/auth-mutation-options.js +0 -23
- package/dist/mutations/magic-link/sign-in-magic-link-mutation.js +0 -33
- package/dist/mutations/multi-session/revoke-multi-session-mutation.js +0 -39
- package/dist/mutations/multi-session/set-active-session-mutation.js +0 -40
- package/dist/mutations/organization/accept-invitation-mutation.js +0 -32
- package/dist/mutations/organization/cancel-invitation-mutation.js +0 -28
- package/dist/mutations/organization/check-slug-mutation.js +0 -30
- package/dist/mutations/organization/create-organization-mutation.js +0 -29
- package/dist/mutations/organization/delete-organization-mutation.js +0 -29
- package/dist/mutations/organization/index.js +0 -12
- package/dist/mutations/organization/invite-member-mutation.js +0 -35
- package/dist/mutations/organization/leave-organization-mutation.js +0 -32
- package/dist/mutations/organization/reject-invitation-mutation.js +0 -25
- package/dist/mutations/organization/remove-member-mutation.js +0 -29
- package/dist/mutations/organization/set-active-organization-mutation.js +0 -72
- package/dist/mutations/organization/update-member-role-mutation.js +0 -36
- package/dist/mutations/organization/update-organization-mutation.js +0 -36
- package/dist/mutations/passkey/add-passkey-mutation.js +0 -40
- package/dist/mutations/passkey/delete-passkey-mutation.js +0 -39
- package/dist/mutations/passkey/sign-in-passkey-mutation.js +0 -38
- package/dist/mutations/settings/change-email-mutation.js +0 -37
- package/dist/mutations/settings/change-password-mutation.js +0 -33
- package/dist/mutations/settings/delete-user-mutation.js +0 -33
- package/dist/mutations/settings/link-social-mutation.js +0 -33
- package/dist/mutations/settings/revoke-session-mutation.js +0 -39
- package/dist/mutations/settings/unlink-account-mutation.js +0 -39
- package/dist/mutations/settings/update-user-mutation.js +0 -36
- package/dist/mutations/username/is-username-available-mutation.js +0 -36
- package/dist/mutations/username/sign-in-username-mutation.js +0 -37
- package/dist/plugins/captcha-plugin.js +0 -34
- package/dist/queries/api-key/list-api-keys-query.js +0 -54
- package/dist/queries/auth/session-query.js +0 -72
- package/dist/queries/auth-query-options.js +0 -21
- package/dist/queries/multi-session/list-device-sessions-query.js +0 -85
- package/dist/queries/organization/active-organization-query.js +0 -37
- package/dist/queries/organization/full-organization-query.js +0 -31
- package/dist/queries/organization/has-permission-query.js +0 -38
- package/dist/queries/organization/index.js +0 -7
- package/dist/queries/organization/list-invitations-query.js +0 -37
- package/dist/queries/organization/list-members-query.js +0 -37
- package/dist/queries/organization/list-organizations-query.js +0 -31
- package/dist/queries/organization/list-user-invitations-query.js +0 -31
- package/dist/queries/passkey/list-passkeys-query.js +0 -83
- package/dist/queries/settings/account-info-query.js +0 -87
- package/dist/queries/settings/list-accounts-query.js +0 -85
- package/dist/queries/settings/list-sessions-query.js +0 -83
- package/dist/server/queries/api-key/list-api-keys-query.js +0 -49
- package/dist/server/queries/auth/session-query.js +0 -51
- package/dist/server/queries/multi-session/list-device-sessions-query.js +0 -54
- package/dist/server/queries/organization/active-organization-query.js +0 -25
- package/dist/server/queries/organization/full-organization-query.js +0 -21
- package/dist/server/queries/organization/has-permission-query.js +0 -23
- package/dist/server/queries/organization/list-invitations-query.js +0 -21
- package/dist/server/queries/organization/list-members-query.js +0 -21
- package/dist/server/queries/organization/list-organizations-query.js +0 -21
- package/dist/server/queries/organization/list-user-invitations-query.js +0 -21
- package/dist/server/queries/passkey/list-passkeys-query.js +0 -54
- package/dist/server/queries/settings/account-info-query.js +0 -54
- package/dist/server/queries/settings/list-accounts-query.js +0 -54
- package/dist/server/queries/settings/list-sessions-query.js +0 -54
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Body, Button, Container, Head, Heading, Hr, Html, Img, Link, Preview, pixelBasedPreset, Section, Tailwind, Text } from "@react-email/components";
|
|
3
|
-
import { cn } from "../../../lib/utils";
|
|
4
|
-
import { EmailStyles } from "./email-styles";
|
|
5
|
-
const magicLinkEmailLocalization = {
|
|
6
|
-
SIGN_IN_TO_APP_NAME: "Sign in to {appName}",
|
|
7
|
-
SIGN_IN_TO_YOUR_ACCOUNT: "Sign in to your account",
|
|
8
|
-
YOUR_ACCOUNT: "your account",
|
|
9
|
-
LOGO: "Logo",
|
|
10
|
-
CLICK_BUTTON_TO_SIGN_IN: "Click the button below to sign in to your account {emailAddress}.",
|
|
11
|
-
OR_COPY_AND_PASTE_URL: "Or copy and paste this URL into your browser:",
|
|
12
|
-
THIS_LINK_EXPIRES_IN_MINUTES: "This link expires in {expirationMinutes} minutes.",
|
|
13
|
-
EMAIL_SENT_BY: "Email sent by {appName}.",
|
|
14
|
-
IF_YOU_DIDNT_REQUEST_THIS_EMAIL: "If you didn't request this email, you can safely ignore it. Someone else might have typed your email address by mistake.",
|
|
15
|
-
POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Email template component that sends magic link authentication emails for passwordless sign-in.
|
|
19
|
-
*
|
|
20
|
-
* This email includes:
|
|
21
|
-
* - Sign-in button with magic link
|
|
22
|
-
* - Fallback URL for manual copy/paste
|
|
23
|
-
* - Expiration time information
|
|
24
|
-
* - Security notice for unauthorized requests
|
|
25
|
-
* - Customizable branding and styling
|
|
26
|
-
* - Support for light/dark mode themes
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```tsx
|
|
30
|
-
* <MagicLinkEmail
|
|
31
|
-
* url="https://example.com/auth/verify?token=abc123"
|
|
32
|
-
* email="user@example.com"
|
|
33
|
-
* appName="My App"
|
|
34
|
-
* expirationMinutes={5}
|
|
35
|
-
* logoURL="https://example.com/logo.png"
|
|
36
|
-
* darkMode={true}
|
|
37
|
-
* />
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
export const MagicLinkEmail = ({ url, email, appName, expirationMinutes = 5, logoURL, colors, classNames, darkMode = true, poweredBy, head, ...props }) => {
|
|
41
|
-
const localization = {
|
|
42
|
-
...MagicLinkEmail.localization,
|
|
43
|
-
...props.localization
|
|
44
|
-
};
|
|
45
|
-
const previewText = appName
|
|
46
|
-
? localization.SIGN_IN_TO_APP_NAME.replace("{appName}", appName)
|
|
47
|
-
: localization.SIGN_IN_TO_YOUR_ACCOUNT;
|
|
48
|
-
return (_jsxs(Html, { children: [_jsxs(Head, { children: [_jsx("meta", { content: "light dark", name: "color-scheme" }), _jsx("meta", { content: "light dark", name: "supported-color-schemes" }), _jsx(EmailStyles, { colors: colors, darkMode: darkMode }), head] }), _jsx(Preview, { children: previewText }), _jsx(Tailwind, { config: { presets: [pixelBasedPreset] }, children: _jsx(Body, { className: cn("bg-background font-sans", classNames?.body), children: _jsx(Container, { className: cn("mx-auto my-auto max-w-xl px-2 py-10", classNames?.container), children: _jsxs(Section, { className: cn("bg-card text-card-foreground rounded-none border border-border p-8", classNames?.card), children: [logoURL &&
|
|
49
|
-
(typeof logoURL === "string" ? (_jsx(Img, { src: logoURL, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8", classNames?.logo) })) : (_jsxs(_Fragment, { children: [_jsx(Img, { src: logoURL.light, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8 logo-light", classNames?.logo) }), _jsx(Img, { src: logoURL.dark, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("hidden mx-auto mb-8 logo-dark", classNames?.logo) })] }))), _jsx(Heading, { className: cn("m-0 mb-5 text-2xl font-semibold", classNames?.title), children: appName
|
|
50
|
-
? localization.SIGN_IN_TO_APP_NAME.replace("{appName}", appName)
|
|
51
|
-
: localization.SIGN_IN_TO_YOUR_ACCOUNT }), _jsx(Text, { className: cn("m-0 text-sm font-normal", classNames?.content), children: (() => {
|
|
52
|
-
const [beforeEmailAddress, afterEmailAddress] = localization.CLICK_BUTTON_TO_SIGN_IN.split("{emailAddress}");
|
|
53
|
-
return email ? (_jsxs(_Fragment, { children: [beforeEmailAddress, _jsx(Link, { href: `mailto:${email}`, className: "text-primary font-medium", children: email }), afterEmailAddress] })) : (localization.CLICK_BUTTON_TO_SIGN_IN.replace("{emailAddress}", "")
|
|
54
|
-
.replace(/\s{2,}/g, " ")
|
|
55
|
-
.replace(" .", "."));
|
|
56
|
-
})() }), _jsx(Section, { className: "my-6", children: _jsx(Button, { href: url, className: cn("inline-block whitespace-nowrap rounded-none text-sm font-medium py-2.5 px-6 bg-primary text-primary-foreground no-underline", classNames?.button), children: appName
|
|
57
|
-
? localization.SIGN_IN_TO_APP_NAME.replace("{appName}", appName)
|
|
58
|
-
: localization.SIGN_IN_TO_YOUR_ACCOUNT }) }), _jsx(Text, { className: cn("m-0 mb-3 text-xs text-muted-foreground", classNames?.description), children: localization.OR_COPY_AND_PASTE_URL }), _jsx(Link, { className: cn("break-all text-xs text-primary", classNames?.link), href: url, children: url }), _jsx(Hr, { className: cn("my-6 w-full border border-solid border-border", classNames?.separator) }), expirationMinutes || appName ? (_jsxs(Text, { className: cn("m-0 mb-3 text-xs text-muted-foreground", classNames?.description), children: [expirationMinutes
|
|
59
|
-
? localization.THIS_LINK_EXPIRES_IN_MINUTES.replace("{expirationMinutes}", expirationMinutes.toString())
|
|
60
|
-
: null, appName && (_jsxs(_Fragment, { children: [expirationMinutes ? " " : "", localization.EMAIL_SENT_BY.replace("{appName}", appName)] }))] })) : null, _jsx(Text, { className: cn("m-0 text-xs text-muted-foreground", classNames?.description), children: localization.IF_YOU_DIDNT_REQUEST_THIS_EMAIL }), poweredBy && (_jsx(Text, { className: cn("m-0 mt-4 text-center text-[11px] text-muted-foreground", classNames?.poweredBy), children: (() => {
|
|
61
|
-
const [beforeBetterAuth, afterBetterAuth] = localization.POWERED_BY_BETTER_AUTH.split("{betterAuth}");
|
|
62
|
-
return (_jsxs(_Fragment, { children: [beforeBetterAuth, _jsx(Link, { href: "https://better-auth.com", className: cn("text-primary underline", classNames?.link), children: "better-auth" }), afterBetterAuth] }));
|
|
63
|
-
})() }))] }) }) }) })] }));
|
|
64
|
-
};
|
|
65
|
-
MagicLinkEmail.localization = magicLinkEmailLocalization;
|
|
66
|
-
MagicLinkEmail.PreviewProps = {
|
|
67
|
-
url: "https://better-auth-ui.com/auth/verify?token=example-token",
|
|
68
|
-
email: "m@example.com",
|
|
69
|
-
appName: "Better Auth",
|
|
70
|
-
darkMode: true
|
|
71
|
-
};
|
|
72
|
-
export default MagicLinkEmail;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Body, Button, Container, Head, Heading, Hr, Html, Img, Link, Preview, pixelBasedPreset, Section, Tailwind, Text } from "@react-email/components";
|
|
3
|
-
import { cn } from "../../../lib/utils";
|
|
4
|
-
import { EmailStyles } from "./email-styles";
|
|
5
|
-
const newDeviceEmailLocalization = {
|
|
6
|
-
NEW_SIGN_IN_DETECTED: "New sign-in detected",
|
|
7
|
-
LOGO: "Logo",
|
|
8
|
-
NEW_SIGN_IN_TO_YOUR_ACCOUNT: "We detected a new sign-in to your {appName} account {userEmail} from a device we don't recognize.",
|
|
9
|
-
DEVICE_DETAILS: "Device details",
|
|
10
|
-
BROWSER: "Browser",
|
|
11
|
-
OPERATING_SYSTEM: "Operating System",
|
|
12
|
-
LOCATION: "Location",
|
|
13
|
-
IP_ADDRESS: "IP Address",
|
|
14
|
-
TIME: "Time",
|
|
15
|
-
IF_THIS_WAS_YOU: "If this was you, you can safely ignore this email. If you don't recognize this activity, please secure your account immediately.",
|
|
16
|
-
SECURE_MY_ACCOUNT: "Secure my account",
|
|
17
|
-
EMAIL_SENT_BY: "Email sent by {appName}.",
|
|
18
|
-
IF_YOU_DIDNT_SIGN_IN: "If you didn't sign in, please contact support immediately {supportEmail} to secure your account.",
|
|
19
|
-
POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Email template component that notifies users when a new device signs into their account.
|
|
23
|
-
*
|
|
24
|
-
* This email includes:
|
|
25
|
-
* - Device information display (browser, OS, location, IP, timestamp)
|
|
26
|
-
* - Secure account action button
|
|
27
|
-
* - Security warnings and support contact information
|
|
28
|
-
* - Customizable branding and styling
|
|
29
|
-
* - Support for light/dark mode themes
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```tsx
|
|
33
|
-
* <NewDeviceEmail
|
|
34
|
-
* userEmail="user@example.com"
|
|
35
|
-
* deviceInfo={{
|
|
36
|
-
* browser: "Chrome on macOS",
|
|
37
|
-
* os: "macOS 14.0",
|
|
38
|
-
* location: "San Francisco, CA",
|
|
39
|
-
* ipAddress: "192.168.1.1",
|
|
40
|
-
* timestamp: "February 10, 2025 at 4:20 PM UTC"
|
|
41
|
-
* }}
|
|
42
|
-
* secureAccountLink="https://example.com/secure-account"
|
|
43
|
-
* appName="My App"
|
|
44
|
-
* supportEmail="support@example.com"
|
|
45
|
-
* darkMode={true}
|
|
46
|
-
* />
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
export const NewDeviceEmail = ({ userEmail, deviceInfo, secureAccountLink, appName, supportEmail, logoURL, colors, classNames, darkMode = true, poweredBy, head, ...props }) => {
|
|
50
|
-
const localization = {
|
|
51
|
-
...NewDeviceEmail.localization,
|
|
52
|
-
...props.localization
|
|
53
|
-
};
|
|
54
|
-
const previewText = localization.NEW_SIGN_IN_DETECTED;
|
|
55
|
-
return (_jsxs(Html, { children: [_jsxs(Head, { children: [_jsx("meta", { content: "light dark", name: "color-scheme" }), _jsx("meta", { content: "light dark", name: "supported-color-schemes" }), _jsx(EmailStyles, { colors: colors, darkMode: darkMode }), head] }), _jsx(Preview, { children: previewText }), _jsx(Tailwind, { config: { presets: [pixelBasedPreset] }, children: _jsx(Body, { className: cn("bg-background font-sans", classNames?.body), children: _jsx(Container, { className: cn("mx-auto my-auto max-w-xl px-2 py-10", classNames?.container), children: _jsxs(Section, { className: cn("bg-card text-card-foreground rounded-none border border-border p-8", classNames?.card), children: [logoURL &&
|
|
56
|
-
(typeof logoURL === "string" ? (_jsx(Img, { src: logoURL, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8", classNames?.logo) })) : (_jsxs(_Fragment, { children: [_jsx(Img, { src: logoURL.light, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8 logo-light", classNames?.logo) }), _jsx(Img, { src: logoURL.dark, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("hidden mx-auto mb-8 logo-dark", classNames?.logo) })] }))), _jsx(Heading, { className: cn("m-0 mb-5 text-2xl font-semibold", classNames?.title), children: localization.NEW_SIGN_IN_DETECTED }), _jsx(Text, { className: cn("text-sm font-normal", classNames?.content), children: (() => {
|
|
57
|
-
const textWithAppName = localization.NEW_SIGN_IN_TO_YOUR_ACCOUNT.replace("{appName}", appName || "")
|
|
58
|
-
.replace(/\s{2,}/g, " ")
|
|
59
|
-
.replace(" .", ".");
|
|
60
|
-
const [beforeUserEmail, afterUserEmail] = textWithAppName.split("{userEmail}");
|
|
61
|
-
return userEmail ? (_jsxs(_Fragment, { children: [beforeUserEmail, _jsx(Link, { href: `mailto:${userEmail}`, className: "text-primary font-medium", children: userEmail }), afterUserEmail] })) : (textWithAppName
|
|
62
|
-
.replace("{userEmail}", "")
|
|
63
|
-
.replace(/\s{2,}/g, " ")
|
|
64
|
-
.replace(" .", "."));
|
|
65
|
-
})() }), deviceInfo && (_jsxs(Section, { className: cn("my-6 border border-border bg-muted p-4", classNames?.codeBlock), children: [_jsxs(Text, { className: cn("m-0 mb-3 text-xs text-muted-foreground", classNames?.description), children: [localization.DEVICE_DETAILS, ":"] }), deviceInfo.browser && (_jsxs(Text, { className: cn("m-0 mb-2 text-sm", classNames?.content), children: [_jsxs("span", { className: "font-semibold", children: [localization.BROWSER, ":"] }), " ", deviceInfo.browser] })), deviceInfo.os && (_jsxs(Text, { className: cn("m-0 mb-2 text-sm", classNames?.content), children: [_jsxs("span", { className: "font-semibold", children: [localization.OPERATING_SYSTEM, ":"] }), " ", deviceInfo.os] })), deviceInfo.location && (_jsxs(Text, { className: cn("m-0 mb-2 text-sm", classNames?.content), children: [_jsxs("span", { className: "font-semibold", children: [localization.LOCATION, ":"] }), " ", deviceInfo.location] })), deviceInfo.ipAddress && (_jsxs(Text, { className: cn("m-0 mb-2 text-sm", classNames?.content), children: [_jsxs("span", { className: "font-semibold", children: [localization.IP_ADDRESS, ":"] }), " ", deviceInfo.ipAddress] })), deviceInfo.timestamp && (_jsxs(Text, { className: cn("m-0 text-sm", classNames?.content), children: [_jsxs("span", { className: "font-semibold", children: [localization.TIME, ":"] }), " ", deviceInfo.timestamp] }))] })), _jsx(Text, { className: cn("text-sm font-normal", classNames?.content), children: localization.IF_THIS_WAS_YOU }), secureAccountLink && (_jsx(Section, { className: "mt-6", children: _jsx(Button, { href: secureAccountLink, className: cn("inline-block whitespace-nowrap rounded-none text-sm font-medium py-2.5 px-6 bg-primary text-primary-foreground no-underline", classNames?.button), children: localization.SECURE_MY_ACCOUNT }) })), _jsx(Hr, { className: cn("my-6 w-full border border-solid border-border", classNames?.separator) }), appName && (_jsx(Text, { className: cn("mb-3 text-xs text-muted-foreground", classNames?.description), children: localization.EMAIL_SENT_BY.replace("{appName}", appName) })), _jsx(Text, { className: cn("mt-3 text-xs text-muted-foreground", classNames?.description), children: (() => {
|
|
66
|
-
const [beforeSupportEmail, afterSupportEmail] = localization.IF_YOU_DIDNT_SIGN_IN.split("{supportEmail}");
|
|
67
|
-
return supportEmail ? (_jsxs(_Fragment, { children: [beforeSupportEmail, _jsx(Link, { href: `mailto:${supportEmail}`, className: cn("text-primary underline", classNames?.link), children: supportEmail }), afterSupportEmail] })) : (localization.IF_YOU_DIDNT_SIGN_IN.replace("{supportEmail}", "")
|
|
68
|
-
.replace(/\s{2,}/g, " ")
|
|
69
|
-
.replace(" .", "."));
|
|
70
|
-
})() }), poweredBy && (_jsx(Text, { className: cn("mt-4 mb-0 text-center text-[11px] text-muted-foreground", classNames?.poweredBy), children: (() => {
|
|
71
|
-
const [beforeBetterAuth, afterBetterAuth] = localization.POWERED_BY_BETTER_AUTH.split("{betterAuth}");
|
|
72
|
-
return (_jsxs(_Fragment, { children: [beforeBetterAuth, _jsx(Link, { href: "https://better-auth.com", className: cn("text-primary underline", classNames?.link), children: "better-auth" }), afterBetterAuth] }));
|
|
73
|
-
})() }))] }) }) }) })] }));
|
|
74
|
-
};
|
|
75
|
-
NewDeviceEmail.localization = newDeviceEmailLocalization;
|
|
76
|
-
NewDeviceEmail.PreviewProps = {
|
|
77
|
-
userEmail: "m@example.com",
|
|
78
|
-
deviceInfo: {
|
|
79
|
-
browser: "Chrome on macOS",
|
|
80
|
-
os: "macOS 26.2",
|
|
81
|
-
location: "San Francisco, CA, United States",
|
|
82
|
-
ipAddress: "127.0.0.1",
|
|
83
|
-
timestamp: "February 10, 2025 at 4:20 PM UTC"
|
|
84
|
-
},
|
|
85
|
-
secureAccountLink: "https://better-auth-ui.com/auth/secure-account",
|
|
86
|
-
appName: "Better Auth",
|
|
87
|
-
supportEmail: "support@example.com",
|
|
88
|
-
darkMode: true
|
|
89
|
-
};
|
|
90
|
-
export default NewDeviceEmail;
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Body, Button, Container, Head, Heading, Hr, Html, Img, Link, Preview, pixelBasedPreset, Section, Tailwind, Text } from "@react-email/components";
|
|
3
|
-
import { cn } from "../../../lib/utils";
|
|
4
|
-
import { EmailStyles } from "./email-styles";
|
|
5
|
-
const organizationInvitationEmailLocalization = {
|
|
6
|
-
YOU_RE_INVITED_TO_ORGANIZATION: "You're invited to {organizationName}",
|
|
7
|
-
YOU_RE_INVITED: "You're invited",
|
|
8
|
-
LOGO: "Logo",
|
|
9
|
-
ORGANIZATION_LOGO: "Organization logo",
|
|
10
|
-
INVITED_TO_JOIN_ORGANIZATION: "{inviterName} ({inviterEmail}) has invited you to join {organizationName} on {appName} as a {role}.",
|
|
11
|
-
ACCEPT_INVITATION: "Accept invitation",
|
|
12
|
-
VIEW_INVITATION: "View invitation",
|
|
13
|
-
OR_COPY_AND_PASTE_URL: "Or copy and paste this URL into your browser:",
|
|
14
|
-
THIS_INVITATION_EXPIRES_IN_HOURS: "This invitation expires in {expirationHours} hours.",
|
|
15
|
-
EMAIL_SENT_BY: "Email sent by {appName}.",
|
|
16
|
-
IF_YOU_DIDNT_EXPECT_THIS_INVITATION: "If you didn't expect this invitation, you can safely ignore this email.",
|
|
17
|
-
POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Email template component that invites a user to join an organization.
|
|
21
|
-
*
|
|
22
|
-
* This email includes:
|
|
23
|
-
* - Inviter and organization details
|
|
24
|
-
* - Role being offered
|
|
25
|
-
* - Accept invitation button linking to `{baseUrl}/settings/organizations`
|
|
26
|
-
* - Fallback URL for manual copy/paste
|
|
27
|
-
* - Optional expiration time information
|
|
28
|
-
* - Security notice for unexpected invitations
|
|
29
|
-
* - Customizable branding and styling
|
|
30
|
-
* - Support for light/dark mode themes
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```tsx
|
|
34
|
-
* <OrganizationInvitationEmail
|
|
35
|
-
* url="https://example.com/settings/organizations"
|
|
36
|
-
* email="invitee@example.com"
|
|
37
|
-
* inviterName="Jane Doe"
|
|
38
|
-
* inviterEmail="jane@example.com"
|
|
39
|
-
* organizationName="Acme Inc."
|
|
40
|
-
* organizationLogoURL="https://example.com/acme-logo.png"
|
|
41
|
-
* role="member"
|
|
42
|
-
* appName="My App"
|
|
43
|
-
* expirationHours={48}
|
|
44
|
-
* darkMode={true}
|
|
45
|
-
* />
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
export const OrganizationInvitationEmail = ({ url, email, inviterName, inviterEmail, organizationName, organizationLogoURL, role, appName, expirationHours = 48, logoURL, colors, classNames, darkMode = true, poweredBy, head, ...props }) => {
|
|
49
|
-
const localization = {
|
|
50
|
-
...OrganizationInvitationEmail.localization,
|
|
51
|
-
...props.localization
|
|
52
|
-
};
|
|
53
|
-
const previewText = organizationName
|
|
54
|
-
? localization.YOU_RE_INVITED_TO_ORGANIZATION.replace("{organizationName}", organizationName)
|
|
55
|
-
: localization.YOU_RE_INVITED;
|
|
56
|
-
return (_jsxs(Html, { children: [_jsxs(Head, { children: [_jsx("meta", { content: "light dark", name: "color-scheme" }), _jsx("meta", { content: "light dark", name: "supported-color-schemes" }), _jsx(EmailStyles, { colors: colors, darkMode: darkMode }), head] }), _jsx(Preview, { children: previewText }), _jsx(Tailwind, { config: { presets: [pixelBasedPreset] }, children: _jsx(Body, { className: cn("bg-background font-sans", classNames?.body), children: _jsx(Container, { className: cn("mx-auto my-auto max-w-xl px-2 py-10", classNames?.container), children: _jsxs(Section, { className: cn("bg-card text-card-foreground rounded-none border border-border p-8", classNames?.card), children: [logoURL &&
|
|
57
|
-
(typeof logoURL === "string" ? (_jsx(Img, { src: logoURL, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8", classNames?.logo) })) : (_jsxs(_Fragment, { children: [_jsx(Img, { src: logoURL.light, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8 logo-light", classNames?.logo) }), _jsx(Img, { src: logoURL.dark, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("hidden mx-auto mb-8 logo-dark", classNames?.logo) })] }))), _jsx(Heading, { className: cn("m-0 mb-5 text-2xl font-semibold", classNames?.title), children: organizationName
|
|
58
|
-
? localization.YOU_RE_INVITED_TO_ORGANIZATION.replace("{organizationName}", organizationName)
|
|
59
|
-
: localization.YOU_RE_INVITED }), organizationLogoURL &&
|
|
60
|
-
(typeof organizationLogoURL === "string" ? (_jsx(Img, { src: organizationLogoURL, width: 56, height: 56, alt: organizationName || localization.ORGANIZATION_LOGO, className: cn("mb-5 rounded-md", classNames?.logo) })) : (_jsxs(_Fragment, { children: [_jsx(Img, { src: organizationLogoURL.light, width: 56, height: 56, alt: organizationName || localization.ORGANIZATION_LOGO, className: cn("mb-5 rounded-md logo-light", classNames?.logo) }), _jsx(Img, { src: organizationLogoURL.dark, width: 56, height: 56, alt: organizationName || localization.ORGANIZATION_LOGO, className: cn("hidden mb-5 rounded-md logo-dark", classNames?.logo) })] }))), _jsx(Text, { className: cn("m-0 text-sm font-normal", classNames?.content), children: (() => {
|
|
61
|
-
let text = localization.INVITED_TO_JOIN_ORGANIZATION.replace("{appName}", appName || "")
|
|
62
|
-
.replace("{organizationName}", organizationName || "")
|
|
63
|
-
.replace("{role}", role || "");
|
|
64
|
-
// If we have no inviter info, drop the parenthetical and name placeholders cleanly.
|
|
65
|
-
if (!inviterName && !inviterEmail) {
|
|
66
|
-
text = text
|
|
67
|
-
.replace("{inviterName} ({inviterEmail})", "Someone")
|
|
68
|
-
.replace("{inviterName}", "Someone")
|
|
69
|
-
.replace("({inviterEmail})", "");
|
|
70
|
-
}
|
|
71
|
-
const [beforeInviterName, afterInviterName] = text.split("{inviterName}");
|
|
72
|
-
const renderInviterEmail = (segment) => {
|
|
73
|
-
const [beforeInviterEmail, afterInviterEmail] = segment.split("{inviterEmail}");
|
|
74
|
-
if (!inviterEmail) {
|
|
75
|
-
return segment
|
|
76
|
-
.replace("({inviterEmail})", "")
|
|
77
|
-
.replace("{inviterEmail}", "")
|
|
78
|
-
.replace(/\s{2,}/g, " ")
|
|
79
|
-
.replace(" .", ".");
|
|
80
|
-
}
|
|
81
|
-
return (_jsxs(_Fragment, { children: [beforeInviterEmail, _jsx(Link, { href: `mailto:${inviterEmail}`, className: "text-primary font-medium", children: inviterEmail }), afterInviterEmail] }));
|
|
82
|
-
};
|
|
83
|
-
if (!inviterName) {
|
|
84
|
-
return renderInviterEmail(text
|
|
85
|
-
.replace("{inviterName}", "")
|
|
86
|
-
.replace(/\s{2,}/g, " ")
|
|
87
|
-
.replace(" .", "."));
|
|
88
|
-
}
|
|
89
|
-
return (_jsxs(_Fragment, { children: [beforeInviterName, _jsx("span", { className: "font-medium", children: inviterName }), renderInviterEmail(afterInviterName ?? "")] }));
|
|
90
|
-
})() }), _jsx(Section, { className: "my-6", children: _jsx(Button, { href: url, className: cn("inline-block whitespace-nowrap rounded-none text-sm font-medium py-2.5 px-6 bg-primary text-primary-foreground no-underline", classNames?.button), children: localization.ACCEPT_INVITATION }) }), _jsx(Text, { className: cn("m-0 mb-3 text-xs text-muted-foreground", classNames?.description), children: localization.OR_COPY_AND_PASTE_URL }), _jsx(Link, { className: cn("break-all text-xs text-primary", classNames?.link), href: url, children: url }), _jsx(Hr, { className: cn("my-6 w-full border border-solid border-border", classNames?.separator) }), expirationHours || appName ? (_jsxs(Text, { className: cn("m-0 mb-3 text-xs text-muted-foreground", classNames?.description), children: [expirationHours
|
|
91
|
-
? localization.THIS_INVITATION_EXPIRES_IN_HOURS.replace("{expirationHours}", expirationHours.toString())
|
|
92
|
-
: null, appName && (_jsxs(_Fragment, { children: [expirationHours ? " " : "", localization.EMAIL_SENT_BY.replace("{appName}", appName)] }))] })) : null, _jsx(Text, { className: cn("m-0 text-xs text-muted-foreground", classNames?.description), children: localization.IF_YOU_DIDNT_EXPECT_THIS_INVITATION }), poweredBy && (_jsx(Text, { className: cn("m-0 mt-4 text-center text-[11px] text-muted-foreground", classNames?.poweredBy), children: (() => {
|
|
93
|
-
const [beforeBetterAuth, afterBetterAuth] = localization.POWERED_BY_BETTER_AUTH.split("{betterAuth}");
|
|
94
|
-
return (_jsxs(_Fragment, { children: [beforeBetterAuth, _jsx(Link, { href: "https://better-auth.com", className: cn("text-primary underline", classNames?.link), children: "better-auth" }), afterBetterAuth] }));
|
|
95
|
-
})() }))] }) }) }) })] }));
|
|
96
|
-
};
|
|
97
|
-
OrganizationInvitationEmail.localization =
|
|
98
|
-
organizationInvitationEmailLocalization;
|
|
99
|
-
OrganizationInvitationEmail.PreviewProps = {
|
|
100
|
-
url: "https://better-auth-ui.com/settings/organizations",
|
|
101
|
-
email: "m@example.com",
|
|
102
|
-
inviterName: "Jane Doe",
|
|
103
|
-
inviterEmail: "jane@example.com",
|
|
104
|
-
organizationName: "Acme Inc.",
|
|
105
|
-
role: "member",
|
|
106
|
-
appName: "Better Auth",
|
|
107
|
-
expirationHours: 48,
|
|
108
|
-
darkMode: true
|
|
109
|
-
};
|
|
110
|
-
export default OrganizationInvitationEmail;
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Body, Container, Head, Heading, Hr, Html, Img, Link, Preview, pixelBasedPreset, Section, Tailwind, Text } from "@react-email/components";
|
|
3
|
-
import { cn } from "../../../lib/utils";
|
|
4
|
-
import { EmailStyles } from "./email-styles";
|
|
5
|
-
const otpEmailLocalization = {
|
|
6
|
-
YOUR_VERIFICATION_CODE_IS_CODE: "Your verification code is {verificationCode}",
|
|
7
|
-
LOGO: "Logo",
|
|
8
|
-
VERIFY_YOUR_EMAIL: "Verify your email",
|
|
9
|
-
WE_NEED_TO_VERIFY_YOUR_EMAIL_ADDRESS: "We need to verify your email address {email} before you can access your {appName} account. Enter the code below in your open browser window.",
|
|
10
|
-
THIS_CODE_EXPIRES_IN_MINUTES: "This code expires in {expirationMinutes} minutes.",
|
|
11
|
-
EMAIL_SENT_BY: "Email sent by {appName}.",
|
|
12
|
-
IF_YOU_DIDNT_REQUEST_THIS_EMAIL: "If you didn't request this email, you can safely ignore it. Someone else might have typed your email address by mistake.",
|
|
13
|
-
POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Email template component that sends one-time password (OTP) verification codes to users.
|
|
17
|
-
*
|
|
18
|
-
* This email includes:
|
|
19
|
-
* - Large, prominently displayed verification code
|
|
20
|
-
* - Expiration time information
|
|
21
|
-
* - Security notice for unauthorized requests
|
|
22
|
-
* - Customizable branding and styling
|
|
23
|
-
* - Support for light/dark mode themes
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```tsx
|
|
27
|
-
* <OtpEmail
|
|
28
|
-
* verificationCode="069420"
|
|
29
|
-
* email="user@example.com"
|
|
30
|
-
* appName="My App"
|
|
31
|
-
* expirationMinutes={10}
|
|
32
|
-
* logoURL="https://example.com/logo.png"
|
|
33
|
-
* darkMode={true}
|
|
34
|
-
* />
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
export const OtpEmail = ({ verificationCode, email, appName, expirationMinutes = 10, logoURL, colors, classNames, darkMode = true, poweredBy, head, ...props }) => {
|
|
38
|
-
const localization = {
|
|
39
|
-
...OtpEmail.localization,
|
|
40
|
-
...props.localization
|
|
41
|
-
};
|
|
42
|
-
const previewText = localization.YOUR_VERIFICATION_CODE_IS_CODE.replace("{verificationCode}", verificationCode);
|
|
43
|
-
return (_jsxs(Html, { children: [_jsxs(Head, { children: [_jsx("meta", { content: "light dark", name: "color-scheme" }), _jsx("meta", { content: "light dark", name: "supported-color-schemes" }), _jsx(EmailStyles, { colors: colors, darkMode: darkMode }), head] }), _jsx(Preview, { children: previewText }), _jsx(Tailwind, { config: { presets: [pixelBasedPreset] }, children: _jsx(Body, { className: cn("bg-background font-sans", classNames?.body), children: _jsx(Container, { className: cn("mx-auto my-auto max-w-xl px-2 py-10", classNames?.container), children: _jsxs(Section, { className: cn("bg-card text-card-foreground rounded-none border border-border p-8", classNames?.card), children: [logoURL &&
|
|
44
|
-
(typeof logoURL === "string" ? (_jsx(Img, { src: logoURL, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8", classNames?.logo) })) : (_jsxs(_Fragment, { children: [_jsx(Img, { src: logoURL.light, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8 logo-light", classNames?.logo) }), _jsx(Img, { src: logoURL.dark, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("hidden mx-auto mb-8 logo-dark", classNames?.logo) })] }))), _jsx(Heading, { className: cn("mb-5 text-2xl font-semibold", classNames?.title), children: localization.VERIFY_YOUR_EMAIL }), _jsx(Text, { className: cn("text-sm font-normal", classNames?.content), children: (() => {
|
|
45
|
-
const textWithAppName = localization.WE_NEED_TO_VERIFY_YOUR_EMAIL_ADDRESS.replace("{appName}", appName || "")
|
|
46
|
-
.replace(/\s{2,}/g, " ")
|
|
47
|
-
.replace(" .", ".");
|
|
48
|
-
const [beforeEmail, afterEmail] = textWithAppName.split("{email}");
|
|
49
|
-
return email ? (_jsxs(_Fragment, { children: [beforeEmail, _jsx(Link, { href: `mailto:${email}`, className: "text-primary font-medium", children: email }), afterEmail] })) : (textWithAppName
|
|
50
|
-
.replace("{email}", "")
|
|
51
|
-
.replace(/\s{2,}/g, " ")
|
|
52
|
-
.replace(" .", "."));
|
|
53
|
-
})() }), _jsx(Section, { className: cn("my-6 border border-border bg-muted p-6", classNames?.codeBlock), children: _jsx(Text, { className: cn("m-0 text-center text-4xl font-semibold tracking-widest", classNames?.title), children: verificationCode }) }), _jsx(Hr, { className: cn("my-6 w-full border border-solid border-border", classNames?.separator) }), _jsxs(Text, { className: cn("mb-3 text-xs text-muted-foreground", classNames?.description), children: [localization.THIS_CODE_EXPIRES_IN_MINUTES.replace("{expirationMinutes}", expirationMinutes.toString()), appName && (_jsxs(_Fragment, { children: [" ", localization.EMAIL_SENT_BY.replace("{appName}", appName)] }))] }), _jsx(Text, { className: cn("mt-3 text-xs text-muted-foreground", classNames?.description), children: localization.IF_YOU_DIDNT_REQUEST_THIS_EMAIL }), poweredBy && (_jsx(Text, { className: cn("mt-4 mb-0 text-center text-[11px] text-muted-foreground", classNames?.poweredBy), children: (() => {
|
|
54
|
-
const [beforeBetterAuth, afterBetterAuth] = localization.POWERED_BY_BETTER_AUTH.split("{betterAuth}");
|
|
55
|
-
return (_jsxs(_Fragment, { children: [beforeBetterAuth, _jsx(Link, { href: "https://better-auth.com", className: cn("text-primary underline", classNames?.link), children: "better-auth" }), afterBetterAuth] }));
|
|
56
|
-
})() }))] }) }) }) })] }));
|
|
57
|
-
};
|
|
58
|
-
OtpEmail.localization = otpEmailLocalization;
|
|
59
|
-
OtpEmail.PreviewProps = {
|
|
60
|
-
verificationCode: "069420",
|
|
61
|
-
email: "m@example.com",
|
|
62
|
-
appName: "Better Auth",
|
|
63
|
-
darkMode: true
|
|
64
|
-
};
|
|
65
|
-
export default OtpEmail;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Body, Button, Container, Head, Heading, Hr, Html, Img, Link, Preview, pixelBasedPreset, Section, Tailwind, Text } from "@react-email/components";
|
|
3
|
-
import { cn } from "../../../lib/utils";
|
|
4
|
-
import { EmailStyles } from "./email-styles";
|
|
5
|
-
const passwordChangedEmailLocalization = {
|
|
6
|
-
YOUR_PASSWORD_HAS_BEEN_CHANGED: "Your password has been changed",
|
|
7
|
-
LOGO: "Logo",
|
|
8
|
-
PASSWORD_CHANGED_SUCCESSFULLY: "Password changed successfully",
|
|
9
|
-
PASSWORD_FOR_YOUR_ACCOUNT_CHANGED: "The password for your {appName} account {userEmail} has been changed successfully.",
|
|
10
|
-
CHANGED_AT: "Changed at",
|
|
11
|
-
IF_YOU_MADE_THIS_CHANGE: "If you made this change, you can safely ignore this email. Your account is secure.",
|
|
12
|
-
I_DIDNT_MAKE_THIS_CHANGE: "I didn't make this change",
|
|
13
|
-
EMAIL_SENT_BY: "Email sent by {appName}.",
|
|
14
|
-
IF_YOU_DIDNT_AUTHORIZE_THIS_CHANGE: "If you didn't authorize this change, please contact support immediately {supportEmail} to secure your account.",
|
|
15
|
-
POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
|
|
16
|
-
};
|
|
17
|
-
/**
|
|
18
|
-
* Email template component that notifies users when their password has been changed.
|
|
19
|
-
*
|
|
20
|
-
* This email includes:
|
|
21
|
-
* - Password change confirmation message
|
|
22
|
-
* - Timestamp of the change
|
|
23
|
-
* - Secure account action button if unauthorized change occurred
|
|
24
|
-
* - Security warnings and support contact information
|
|
25
|
-
* - Customizable branding and styling
|
|
26
|
-
* - Support for light/dark mode themes
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```tsx
|
|
30
|
-
* <PasswordChangedEmail
|
|
31
|
-
* email="user@example.com"
|
|
32
|
-
* timestamp="February 10, 2025 at 4:20 PM UTC"
|
|
33
|
-
* secureAccountURL="https://example.com/settings/security"
|
|
34
|
-
* appName="My App"
|
|
35
|
-
* supportEmail="support@example.com"
|
|
36
|
-
* logoURL="https://example.com/logo.png"
|
|
37
|
-
* darkMode={true}
|
|
38
|
-
* />
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
export const PasswordChangedEmail = ({ email, timestamp, secureAccountURL, appName, supportEmail, logoURL, colors, classNames, darkMode = true, poweredBy, head, ...props }) => {
|
|
42
|
-
const localization = {
|
|
43
|
-
...PasswordChangedEmail.localization,
|
|
44
|
-
...props.localization
|
|
45
|
-
};
|
|
46
|
-
const previewText = localization.YOUR_PASSWORD_HAS_BEEN_CHANGED;
|
|
47
|
-
return (_jsxs(Html, { children: [_jsxs(Head, { children: [_jsx("meta", { content: "light dark", name: "color-scheme" }), _jsx("meta", { content: "light dark", name: "supported-color-schemes" }), _jsx(EmailStyles, { colors: colors, darkMode: darkMode }), head] }), _jsx(Preview, { children: previewText }), _jsx(Tailwind, { config: { presets: [pixelBasedPreset] }, children: _jsx(Body, { className: cn("bg-background font-sans", classNames?.body), children: _jsx(Container, { className: cn("mx-auto my-auto max-w-xl px-2 py-10", classNames?.container), children: _jsxs(Section, { className: cn("bg-card text-card-foreground rounded-none border border-border p-8", classNames?.card), children: [logoURL &&
|
|
48
|
-
(typeof logoURL === "string" ? (_jsx(Img, { src: logoURL, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8", classNames?.logo) })) : (_jsxs(_Fragment, { children: [_jsx(Img, { src: logoURL.light, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8 logo-light", classNames?.logo) }), _jsx(Img, { src: logoURL.dark, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("hidden mx-auto mb-8 logo-dark", classNames?.logo) })] }))), _jsx(Heading, { className: cn("m-0 mb-5 text-2xl font-semibold", classNames?.title), children: localization.PASSWORD_CHANGED_SUCCESSFULLY }), _jsx(Text, { className: cn("text-sm font-normal", classNames?.content), children: (() => {
|
|
49
|
-
const textWithAppName = localization.PASSWORD_FOR_YOUR_ACCOUNT_CHANGED.replace("{appName}", appName || "")
|
|
50
|
-
.replace(/\s{2,}/g, " ")
|
|
51
|
-
.replace(" .", ".");
|
|
52
|
-
const [beforeUserEmail, afterUserEmail] = textWithAppName.split("{userEmail}");
|
|
53
|
-
return email ? (_jsxs(_Fragment, { children: [beforeUserEmail, _jsx(Link, { href: `mailto:${email}`, className: "text-primary font-medium", children: email }), afterUserEmail] })) : (textWithAppName
|
|
54
|
-
.replace("{userEmail}", "")
|
|
55
|
-
.replace(/\s{2,}/g, " ")
|
|
56
|
-
.replace(" .", "."));
|
|
57
|
-
})() }), timestamp && (_jsxs(Section, { className: cn("my-6 border border-border bg-muted p-4", classNames?.codeBlock), children: [_jsxs(Text, { className: cn("m-0 mb-2 text-xs text-muted-foreground", classNames?.description), children: [localization.CHANGED_AT, ":"] }), _jsx(Text, { className: cn("m-0 text-sm font-semibold", classNames?.content), children: timestamp })] })), _jsx(Text, { className: cn("text-sm font-normal", classNames?.content), children: localization.IF_YOU_MADE_THIS_CHANGE }), secureAccountURL && (_jsx(Section, { className: "mt-6", children: _jsx(Button, { href: secureAccountURL, className: cn("inline-block whitespace-nowrap rounded-none text-sm font-medium py-2.5 px-6 bg-primary text-primary-foreground no-underline", classNames?.button), children: localization.I_DIDNT_MAKE_THIS_CHANGE }) })), _jsx(Hr, { className: cn("my-6 w-full border border-solid border-border", classNames?.separator) }), appName && (_jsx(Text, { className: cn("mb-3 text-xs text-muted-foreground", classNames?.description), children: localization.EMAIL_SENT_BY.replace("{appName}", appName) })), _jsx(Text, { className: cn("mt-3 text-xs text-muted-foreground", classNames?.description), children: (() => {
|
|
58
|
-
const [beforeSupportEmail, afterSupportEmail] = localization.IF_YOU_DIDNT_AUTHORIZE_THIS_CHANGE.split("{supportEmail}");
|
|
59
|
-
return supportEmail ? (_jsxs(_Fragment, { children: [beforeSupportEmail, _jsx(Link, { href: `mailto:${supportEmail}`, className: cn("text-primary underline", classNames?.link), children: supportEmail }), afterSupportEmail] })) : (localization.IF_YOU_DIDNT_AUTHORIZE_THIS_CHANGE.replace("{supportEmail}", "")
|
|
60
|
-
.replace(/\s{2,}/g, " ")
|
|
61
|
-
.replace(" .", "."));
|
|
62
|
-
})() }), poweredBy && (_jsx(Text, { className: cn("mt-4 mb-0 text-center text-[11px] text-muted-foreground", classNames?.poweredBy), children: (() => {
|
|
63
|
-
const [beforeBetterAuth, afterBetterAuth] = localization.POWERED_BY_BETTER_AUTH.split("{betterAuth}");
|
|
64
|
-
return (_jsxs(_Fragment, { children: [beforeBetterAuth, _jsx(Link, { href: "https://better-auth.com", className: cn("text-primary underline", classNames?.link), children: "better-auth" }), afterBetterAuth] }));
|
|
65
|
-
})() }))] }) }) }) })] }));
|
|
66
|
-
};
|
|
67
|
-
PasswordChangedEmail.localization = passwordChangedEmailLocalization;
|
|
68
|
-
PasswordChangedEmail.PreviewProps = {
|
|
69
|
-
email: "m@example.com",
|
|
70
|
-
timestamp: "February 10, 2025 at 4:20 PM UTC",
|
|
71
|
-
secureAccountURL: "https://better-auth-ui.com/settings/security",
|
|
72
|
-
appName: "Better Auth",
|
|
73
|
-
supportEmail: "support@example.com",
|
|
74
|
-
darkMode: true
|
|
75
|
-
};
|
|
76
|
-
export default PasswordChangedEmail;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { Body, Button, Container, Head, Heading, Hr, Html, Img, Link, Preview, pixelBasedPreset, Section, Tailwind, Text } from "@react-email/components";
|
|
3
|
-
import { cn } from "../../../lib/utils";
|
|
4
|
-
import { EmailStyles } from "./email-styles";
|
|
5
|
-
const resetPasswordEmailLocalization = {
|
|
6
|
-
RESET_YOUR_PASSWORD: "Reset your password",
|
|
7
|
-
LOGO: "Logo",
|
|
8
|
-
WE_RECEIVED_REQUEST_TO_RESET_PASSWORD: "We received a request to reset the password for your {appName} account {email}.",
|
|
9
|
-
RESET_PASSWORD: "Reset password",
|
|
10
|
-
OR_COPY_AND_PASTE_URL: "Or copy and paste this URL into your browser:",
|
|
11
|
-
THIS_LINK_EXPIRES_IN_MINUTES: "This link expires in {expirationMinutes} minutes.",
|
|
12
|
-
EMAIL_SENT_BY: "Email sent by {appName}.",
|
|
13
|
-
IF_YOU_DIDNT_REQUEST_PASSWORD_RESET: "If you didn't request a password reset, you can safely ignore this email. Your password will remain unchanged.",
|
|
14
|
-
POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Email template component that sends password reset links to users.
|
|
18
|
-
*
|
|
19
|
-
* This email includes:
|
|
20
|
-
* - Password reset button and fallback URL
|
|
21
|
-
* - Expiration time information
|
|
22
|
-
* - Security notice for unauthorized requests
|
|
23
|
-
* - Customizable branding and styling
|
|
24
|
-
* - Support for light/dark mode themes
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```tsx
|
|
28
|
-
* <ResetPasswordEmail
|
|
29
|
-
* url="https://example.com/auth/reset-password?token=abc123"
|
|
30
|
-
* email="user@example.com"
|
|
31
|
-
* appName="My App"
|
|
32
|
-
* expirationMinutes={60}
|
|
33
|
-
* logoURL="https://example.com/logo.png"
|
|
34
|
-
* darkMode={true}
|
|
35
|
-
* />
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
export const ResetPasswordEmail = ({ url, email, appName, expirationMinutes = 60, logoURL, colors, classNames, darkMode = true, poweredBy, head, ...props }) => {
|
|
39
|
-
const localization = {
|
|
40
|
-
...ResetPasswordEmail.localization,
|
|
41
|
-
...props.localization
|
|
42
|
-
};
|
|
43
|
-
const previewText = localization.RESET_YOUR_PASSWORD;
|
|
44
|
-
return (_jsxs(Html, { children: [_jsxs(Head, { children: [_jsx("meta", { content: "light dark", name: "color-scheme" }), _jsx("meta", { content: "light dark", name: "supported-color-schemes" }), _jsx(EmailStyles, { colors: colors, darkMode: darkMode }), head] }), _jsx(Preview, { children: previewText }), _jsx(Tailwind, { config: { presets: [pixelBasedPreset] }, children: _jsx(Body, { className: cn("bg-background font-sans", classNames?.body), children: _jsx(Container, { className: cn("mx-auto my-auto max-w-xl px-2 py-10", classNames?.container), children: _jsxs(Section, { className: cn("bg-card text-card-foreground rounded-none border border-border p-8", classNames?.card), children: [logoURL &&
|
|
45
|
-
(typeof logoURL === "string" ? (_jsx(Img, { src: logoURL, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8", classNames?.logo) })) : (_jsxs(_Fragment, { children: [_jsx(Img, { src: logoURL.light, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("mx-auto mb-8 logo-light", classNames?.logo) }), _jsx(Img, { src: logoURL.dark, width: 48, height: 48, alt: appName || localization.LOGO, className: cn("hidden mx-auto mb-8 logo-dark", classNames?.logo) })] }))), _jsx(Heading, { className: cn("m-0 mb-5 text-2xl font-semibold", classNames?.title), children: localization.RESET_YOUR_PASSWORD }), _jsx(Text, { className: cn("text-sm", classNames?.content), children: (() => {
|
|
46
|
-
const textWithAppName = localization.WE_RECEIVED_REQUEST_TO_RESET_PASSWORD.replace("{appName}", appName || "")
|
|
47
|
-
.replace(/\s{2,}/g, " ")
|
|
48
|
-
.replace(" .", ".");
|
|
49
|
-
const [beforeEmail, afterEmail] = textWithAppName.split("{email}");
|
|
50
|
-
return email ? (_jsxs(_Fragment, { children: [beforeEmail, _jsx(Link, { href: `mailto:${email}`, className: "text-primary font-medium", children: email }), afterEmail] })) : (textWithAppName
|
|
51
|
-
.replace("{email}", "")
|
|
52
|
-
.replace(/\s{2,}/g, " ")
|
|
53
|
-
.replace(" .", "."));
|
|
54
|
-
})() }), _jsx(Section, { className: "my-6", children: _jsx(Button, { href: url, className: cn("inline-block whitespace-nowrap rounded-none text-sm font-medium py-2.5 px-6 bg-primary text-primary-foreground no-underline", classNames?.button), children: localization.RESET_PASSWORD }) }), _jsx(Text, { className: cn("m-0 mb-3 text-xs text-muted-foreground", classNames?.description), children: localization.OR_COPY_AND_PASTE_URL }), _jsx(Link, { className: cn("break-all text-xs text-primary", classNames?.link), href: url, children: url }), _jsx(Hr, { className: cn("my-6 w-full border border-solid border-border", classNames?.separator) }), expirationMinutes || appName ? (_jsxs(Text, { className: cn("m-0 mb-3 text-xs text-muted-foreground", classNames?.description), children: [expirationMinutes
|
|
55
|
-
? localization.THIS_LINK_EXPIRES_IN_MINUTES.replace("{expirationMinutes}", expirationMinutes.toString())
|
|
56
|
-
: null, appName && (_jsxs(_Fragment, { children: [expirationMinutes ? " " : "", localization.EMAIL_SENT_BY.replace("{appName}", appName)] }))] })) : null, _jsx(Text, { className: cn("m-0 text-xs text-muted-foreground", classNames?.description), children: localization.IF_YOU_DIDNT_REQUEST_PASSWORD_RESET }), poweredBy && (_jsx(Text, { className: cn("m-0 mt-4 text-center text-[11px] text-muted-foreground", classNames?.poweredBy), children: (() => {
|
|
57
|
-
const [beforeBetterAuth, afterBetterAuth] = localization.POWERED_BY_BETTER_AUTH.split("{betterAuth}");
|
|
58
|
-
return (_jsxs(_Fragment, { children: [beforeBetterAuth, _jsx(Link, { href: "https://better-auth.com", className: cn("text-primary underline", classNames?.link), children: "better-auth" }), afterBetterAuth] }));
|
|
59
|
-
})() }))] }) }) }) })] }));
|
|
60
|
-
};
|
|
61
|
-
ResetPasswordEmail.localization = resetPasswordEmailLocalization;
|
|
62
|
-
ResetPasswordEmail.PreviewProps = {
|
|
63
|
-
url: "https://better-auth-ui.com/auth/reset-password?token=example-token",
|
|
64
|
-
email: "m@example.com",
|
|
65
|
-
appName: "Better Auth",
|
|
66
|
-
darkMode: true
|
|
67
|
-
};
|
|
68
|
-
export default ResetPasswordEmail;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useCallback, useContext, useRef, useState } from "react";
|
|
4
|
-
const FetchOptionsContext = createContext(undefined);
|
|
5
|
-
export function FetchOptionsProvider({ children }) {
|
|
6
|
-
const [current, setCurrent] = useState(undefined);
|
|
7
|
-
const resetRef = useRef(null);
|
|
8
|
-
const setFetchOptions = useCallback((fetchOptions) => {
|
|
9
|
-
setCurrent(fetchOptions);
|
|
10
|
-
}, []);
|
|
11
|
-
const registerReset = useCallback((reset) => {
|
|
12
|
-
resetRef.current = reset;
|
|
13
|
-
}, []);
|
|
14
|
-
const resetFetchOptions = useCallback(() => {
|
|
15
|
-
setCurrent(undefined);
|
|
16
|
-
resetRef.current?.();
|
|
17
|
-
}, []);
|
|
18
|
-
return (_jsx(FetchOptionsContext.Provider, { value: {
|
|
19
|
-
fetchOptions: current,
|
|
20
|
-
setFetchOptions,
|
|
21
|
-
resetFetchOptions,
|
|
22
|
-
registerReset
|
|
23
|
-
}, children: children }));
|
|
24
|
-
}
|
|
25
|
-
export function useFetchOptions() {
|
|
26
|
-
const ctx = useContext(FetchOptionsContext);
|
|
27
|
-
if (!ctx) {
|
|
28
|
-
throw new Error("[Better Auth UI] useFetchOptions must be used within FetchOptionsProvider");
|
|
29
|
-
}
|
|
30
|
-
return ctx;
|
|
31
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Renders an Apple SVG icon.
|
|
4
|
-
*
|
|
5
|
-
* @param props - Props forwarded to the root `<svg>` element; they are spread onto the element and can override attributes such as `width`, `height`, `className`, and `aria-label`.
|
|
6
|
-
* @returns The SVG element for the Apple icon.
|
|
7
|
-
*/
|
|
8
|
-
export function Apple(props) {
|
|
9
|
-
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", role: "img", "aria-label": "Apple", ...props, children: _jsx("path", { fill: "currentColor", d: "M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04c-2.04.027-3.91 1.183-4.961 3.014c-2.117 3.675-.546 9.103 1.519 12.09c1.013 1.454 2.208 3.09 3.792 3.039c1.52-.065 2.09-.987 3.935-.987c1.831 0 2.35.987 3.96.948c1.637-.026 2.676-1.48 3.676-2.948c1.156-1.688 1.636-3.325 1.662-3.415c-.039-.013-3.182-1.221-3.22-4.857c-.026-3.04 2.48-4.494 2.597-4.559c-1.429-2.09-3.623-2.324-4.39-2.376c-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83c-1.207.052-2.662.805-3.532 1.818c-.78.896-1.454 2.338-1.273 3.714c1.338.104 2.715-.688 3.559-1.701" }) }));
|
|
10
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useId } from "react";
|
|
3
|
-
/**
|
|
4
|
-
* Render the Atlassian logo as an inline SVG element.
|
|
5
|
-
*
|
|
6
|
-
* The SVG includes a linear gradient and two path shapes, and sets role="img" with aria-label="Atlassian".
|
|
7
|
-
*
|
|
8
|
-
* @param props - Props forwarded to the root SVG element.
|
|
9
|
-
* @returns An SVG element representing the Atlassian icon.
|
|
10
|
-
*/
|
|
11
|
-
export function Atlassian(props) {
|
|
12
|
-
const gradientId = useId();
|
|
13
|
-
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 256 256", role: "img", "aria-label": "Atlassian", ...props, children: [_jsx("defs", { children: _jsxs("linearGradient", { id: gradientId, x1: "99.687%", x2: "39.836%", y1: "15.801%", y2: "97.438%", children: [_jsx("stop", { offset: "0%", stopColor: "#0052cc" }), _jsx("stop", { offset: "92.3%", stopColor: "#2684ff" })] }) }), _jsx("path", { fill: `url(#${gradientId})`, d: "M75.793 117.95c-3.82-4.08-9.77-3.85-12.367 1.342L.791 244.565a7.488 7.488 0 0 0 6.697 10.838h87.228a7.22 7.22 0 0 0 6.699-4.14c18.808-38.89 7.413-98.018-25.622-133.314" }), _jsx("path", { fill: "#2681ff", d: "M121.756 4.011c-35.033 55.505-32.721 116.979-9.646 163.13l42.06 84.121a7.49 7.49 0 0 0 6.697 4.14h87.227a7.488 7.488 0 0 0 6.697-10.838S137.445 9.837 134.493 3.964c-2.64-5.258-9.344-5.33-12.737.047" })] }));
|
|
14
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Renders the Cognito SVG icon as a React component.
|
|
4
|
-
*
|
|
5
|
-
* @param props - Props passed through to the underlying `svg` element (accepts standard SVG attributes and ref).
|
|
6
|
-
* @returns A React `svg` element displaying the Cognito icon
|
|
7
|
-
*/
|
|
8
|
-
export function Cognito(props) {
|
|
9
|
-
return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 48 48", role: "img", "aria-label": "Cognito", ...props, children: [_jsx("path", { fill: "currentColor", d: "M24 4L6 14v20l18 10 18-10V14L24 4zm0 4.62l13.6 7.86v15.04L24 39.38 10.4 31.52V16.48L24 8.62z" }), _jsx("path", { fill: "currentColor", d: "M22 14h4v20h-4zM14 22h20v4H14z" })] }));
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Renders the Discord logo as an SVG element.
|
|
4
|
-
*
|
|
5
|
-
* @param props - Props forwarded to the root `<svg>` element (e.g., `className`, `style`, `aria-*`, event handlers)
|
|
6
|
-
* @returns The SVG element for the Discord icon
|
|
7
|
-
*/
|
|
8
|
-
export function Discord(props) {
|
|
9
|
-
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 256 199", role: "img", "aria-label": "Discord", ...props, children: _jsx("path", { fill: "#5865f2", d: "M216.856 16.597A208.5 208.5 0 0 0 164.042 0c-2.275 4.113-4.933 9.645-6.766 14.046q-29.538-4.442-58.533 0c-1.832-4.4-4.55-9.933-6.846-14.046a207.8 207.8 0 0 0-52.855 16.638C5.618 67.147-3.443 116.4 1.087 164.956c22.169 16.555 43.653 26.612 64.775 33.193A161 161 0 0 0 79.735 175.3a136.4 136.4 0 0 1-21.846-10.632a109 109 0 0 0 5.356-4.237c42.122 19.702 87.89 19.702 129.51 0a132 132 0 0 0 5.355 4.237a136 136 0 0 1-21.886 10.653c4.006 8.02 8.638 15.67 13.873 22.848c21.142-6.58 42.646-16.637 64.815-33.213c5.316-56.288-9.08-105.09-38.056-148.36M85.474 135.095c-12.645 0-23.015-11.805-23.015-26.18s10.149-26.2 23.015-26.2s23.236 11.804 23.015 26.2c.02 14.375-10.148 26.18-23.015 26.18m85.051 0c-12.645 0-23.014-11.805-23.014-26.18s10.148-26.2 23.014-26.2c12.867 0 23.236 11.804 23.015 26.2c0 14.375-10.148 26.18-23.015 26.18" }) }));
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Renders the Dropbox logo as an SVG element.
|
|
4
|
-
*
|
|
5
|
-
* @param props - Props to apply to the root `<svg>` element; all props are forwarded to the SVG.
|
|
6
|
-
* @returns An SVG element containing the Dropbox logo
|
|
7
|
-
*/
|
|
8
|
-
export function Dropbox(props) {
|
|
9
|
-
return (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 256 218", role: "img", "aria-label": "Dropbox", ...props, children: _jsx("path", { fill: "#0061ff", d: "M63.995 0L0 40.771l63.995 40.772L128 40.771zM192 0l-64 40.775l64 40.775l64.001-40.775zM0 122.321l63.995 40.772L128 122.321L63.995 81.55zM192 81.55l-64 40.775l64 40.774l64-40.774zM64 176.771l64.005 40.772L192 176.771L128.005 136z" }) }));
|
|
10
|
-
}
|