@better-auth-ui/react 1.6.7 → 1.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/auth/auth-context.d.ts +3 -0
- package/dist/components/auth/auth-context.js +4 -0
- package/dist/components/auth/auth-provider.d.ts +4 -4
- package/dist/components/auth/auth-provider.js +65 -41
- package/dist/components/auth/email/email-changed.d.ts +2 -2
- package/dist/components/auth/email/email-changed.js +68 -154
- package/dist/components/auth/email/email-localization.d.ts +11 -3
- package/dist/components/auth/email/email-localization.js +25 -18
- package/dist/components/auth/email/email-styles.js +77 -52
- package/dist/components/auth/email/email-verification.d.ts +2 -2
- package/dist/components/auth/email/email-verification.js +73 -138
- package/dist/components/auth/email/index.d.ts +10 -9
- package/dist/components/auth/email/index.js +10 -9
- package/dist/components/auth/email/magic-link.d.ts +2 -2
- package/dist/components/auth/email/magic-link.js +70 -139
- package/dist/components/auth/email/new-device.d.ts +2 -2
- package/dist/components/auth/email/new-device.js +88 -221
- package/dist/components/auth/email/organization-invitation.d.ts +121 -0
- package/dist/components/auth/email/organization-invitation.js +110 -0
- package/dist/components/auth/email/otp-email.d.ts +2 -2
- package/dist/components/auth/email/otp-email.js +63 -127
- package/dist/components/auth/email/password-changed.d.ts +2 -2
- package/dist/components/auth/email/password-changed.js +74 -157
- package/dist/components/auth/email/reset-password.d.ts +2 -2
- package/dist/components/auth/email/reset-password.js +66 -138
- package/dist/components/auth/fetch-options-provider.d.ts +1 -1
- package/dist/components/auth/fetch-options-provider.js +28 -27
- package/dist/components/icons/apple.d.ts +1 -1
- package/dist/components/icons/apple.js +9 -16
- package/dist/components/icons/atlassian.d.ts +1 -1
- package/dist/components/icons/atlassian.js +13 -38
- package/dist/components/icons/cognito.d.ts +1 -1
- package/dist/components/icons/cognito.js +9 -19
- package/dist/components/icons/discord.d.ts +1 -1
- package/dist/components/icons/discord.js +9 -16
- package/dist/components/icons/dropbox.d.ts +1 -1
- package/dist/components/icons/dropbox.js +9 -16
- package/dist/components/icons/facebook.d.ts +1 -1
- package/dist/components/icons/facebook.js +11 -19
- package/dist/components/icons/figma.d.ts +1 -1
- package/dist/components/icons/figma.js +12 -34
- package/dist/components/icons/github.d.ts +1 -1
- package/dist/components/icons/github.js +11 -16
- package/dist/components/icons/gitlab.d.ts +1 -1
- package/dist/components/icons/gitlab.js +9 -30
- package/dist/components/icons/google.d.ts +1 -1
- package/dist/components/icons/google.js +9 -39
- package/dist/components/icons/huggingface.d.ts +1 -1
- package/dist/components/icons/huggingface.js +9 -38
- package/dist/components/icons/index.d.ts +35 -35
- package/dist/components/icons/index.js +35 -35
- package/dist/components/icons/kakao.d.ts +1 -1
- package/dist/components/icons/kakao.js +11 -16
- package/dist/components/icons/kick.d.ts +1 -1
- package/dist/components/icons/kick.js +11 -20
- package/dist/components/icons/line.d.ts +1 -1
- package/dist/components/icons/line.js +9 -16
- package/dist/components/icons/linear.d.ts +1 -1
- package/dist/components/icons/linear.js +9 -16
- package/dist/components/icons/linkedin.d.ts +1 -1
- package/dist/components/icons/linkedin.js +9 -33
- package/dist/components/icons/microsoft.d.ts +1 -1
- package/dist/components/icons/microsoft.js +9 -30
- package/dist/components/icons/naver.d.ts +1 -1
- package/dist/components/icons/naver.js +9 -16
- package/dist/components/icons/notion.d.ts +1 -1
- package/dist/components/icons/notion.js +9 -16
- package/dist/components/icons/paybin.d.ts +1 -1
- package/dist/components/icons/paybin.js +8 -32
- package/dist/components/icons/paypal.d.ts +1 -1
- package/dist/components/icons/paypal.js +9 -30
- package/dist/components/icons/polar.d.ts +1 -1
- package/dist/components/icons/polar.js +9 -24
- package/dist/components/icons/railway.d.ts +1 -1
- package/dist/components/icons/railway.js +9 -16
- package/dist/components/icons/reddit.d.ts +1 -1
- package/dist/components/icons/reddit.js +9 -21
- package/dist/components/icons/roblox.d.ts +1 -1
- package/dist/components/icons/roblox.js +12 -17
- package/dist/components/icons/salesforce.d.ts +1 -1
- package/dist/components/icons/salesforce.js +9 -16
- package/dist/components/icons/slack.d.ts +1 -1
- package/dist/components/icons/slack.js +9 -30
- package/dist/components/icons/spotify.d.ts +1 -1
- package/dist/components/icons/spotify.js +9 -16
- package/dist/components/icons/tiktok.d.ts +1 -1
- package/dist/components/icons/tiktok.js +10 -23
- package/dist/components/icons/twitch.d.ts +1 -1
- package/dist/components/icons/twitch.js +12 -43
- package/dist/components/icons/vercel.d.ts +1 -1
- package/dist/components/icons/vercel.js +9 -16
- package/dist/components/icons/vk.d.ts +1 -1
- package/dist/components/icons/vk.js +9 -16
- package/dist/components/icons/wechat.d.ts +1 -1
- package/dist/components/icons/wechat.js +9 -16
- package/dist/components/icons/x.d.ts +1 -1
- package/dist/components/icons/x.js +9 -16
- package/dist/components/icons/zoom.d.ts +1 -1
- package/dist/components/icons/zoom.js +11 -69
- package/dist/components/mutation-invalidator.d.ts +1 -0
- package/dist/components/mutation-invalidator.js +31 -0
- package/dist/components/settings/account/theme-preview.js +7 -286
- package/dist/email.d.ts +1 -1
- package/dist/email.js +1 -11
- package/dist/hooks/auth/use-authenticate.d.ts +3 -3
- package/dist/hooks/auth/use-authenticate.js +28 -22
- package/dist/hooks/auth/use-user.d.ts +34 -34
- package/dist/hooks/auth/use-user.js +14 -10
- package/dist/hooks/use-auth-mutation.d.ts +4 -4
- package/dist/hooks/use-auth-mutation.js +18 -10
- package/dist/hooks/use-auth-plugin.d.ts +1 -1
- package/dist/hooks/use-auth-plugin.js +26 -8
- package/dist/hooks/use-auth-query.d.ts +3 -3
- package/dist/hooks/use-auth-query.js +20 -14
- package/dist/index.d.ts +48 -45
- package/dist/index.js +47 -79
- package/dist/lib/auth-client.d.ts +7 -4
- package/dist/lib/auth-client.js +1 -0
- package/dist/lib/auth-plugin.d.ts +19 -3
- package/dist/lib/auth-plugin.js +1 -0
- package/dist/lib/auth-server.d.ts +10 -3
- package/dist/lib/auth-server.js +1 -0
- package/dist/lib/provider-icons.d.ts +2 -2
- package/dist/lib/provider-icons.js +47 -75
- package/dist/lib/settings-tab.d.ts +19 -0
- package/dist/lib/settings-tab.js +1 -0
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +4 -7
- package/dist/mutations/api-key/create-api-key-mutation.d.ts +9 -7
- package/dist/mutations/api-key/create-api-key-mutation.js +37 -27
- package/dist/mutations/api-key/delete-api-key-mutation.d.ts +10 -6
- package/dist/mutations/api-key/delete-api-key-mutation.js +37 -27
- package/dist/mutations/auth/request-password-reset-mutation.d.ts +4 -4
- package/dist/mutations/auth/request-password-reset-mutation.js +31 -22
- package/dist/mutations/auth/reset-password-mutation.d.ts +4 -4
- package/dist/mutations/auth/reset-password-mutation.js +32 -22
- package/dist/mutations/auth/send-verification-email-mutation.d.ts +4 -4
- package/dist/mutations/auth/send-verification-email-mutation.js +31 -22
- package/dist/mutations/auth/sign-in-email-mutation.d.ts +10 -10
- package/dist/mutations/auth/sign-in-email-mutation.js +38 -27
- package/dist/mutations/auth/sign-in-social-mutation.d.ts +6 -6
- package/dist/mutations/auth/sign-in-social-mutation.js +36 -22
- package/dist/mutations/auth/sign-out-mutation.d.ts +9 -7
- package/dist/mutations/auth/sign-out-mutation.js +39 -26
- package/dist/mutations/auth/sign-up-email-mutation.d.ts +12 -12
- package/dist/mutations/auth/sign-up-email-mutation.js +34 -27
- package/dist/mutations/auth-mutation-options.d.ts +2 -2
- package/dist/mutations/auth-mutation-options.js +22 -18
- package/dist/mutations/magic-link/sign-in-magic-link-mutation.d.ts +4 -4
- package/dist/mutations/magic-link/sign-in-magic-link-mutation.js +31 -22
- package/dist/mutations/multi-session/revoke-multi-session-mutation.d.ts +8 -8
- package/dist/mutations/multi-session/revoke-multi-session-mutation.js +37 -27
- package/dist/mutations/multi-session/set-active-session-mutation.d.ts +8 -9
- package/dist/mutations/multi-session/set-active-session-mutation.js +38 -29
- package/dist/mutations/organization/accept-invitation-mutation.d.ts +43 -0
- package/dist/mutations/organization/accept-invitation-mutation.js +32 -0
- package/dist/mutations/organization/cancel-invitation-mutation.d.ts +25 -0
- package/dist/mutations/organization/cancel-invitation-mutation.js +28 -0
- package/dist/mutations/organization/check-slug-mutation.d.ts +21 -0
- package/dist/mutations/organization/check-slug-mutation.js +30 -0
- package/dist/mutations/organization/create-organization-mutation.d.ts +39 -0
- package/dist/mutations/organization/create-organization-mutation.js +29 -0
- package/dist/mutations/organization/delete-organization-mutation.d.ts +21 -0
- package/dist/mutations/organization/delete-organization-mutation.js +29 -0
- package/dist/mutations/organization/index.d.ts +12 -0
- package/dist/mutations/organization/index.js +12 -0
- package/dist/mutations/organization/invite-member-mutation.d.ts +43 -0
- package/dist/mutations/organization/invite-member-mutation.js +35 -0
- package/dist/mutations/organization/leave-organization-mutation.d.ts +65 -0
- package/dist/mutations/organization/leave-organization-mutation.js +32 -0
- package/dist/mutations/organization/reject-invitation-mutation.d.ts +31 -0
- package/dist/mutations/organization/reject-invitation-mutation.js +25 -0
- package/dist/mutations/organization/remove-member-mutation.d.ts +35 -0
- package/dist/mutations/organization/remove-member-mutation.js +29 -0
- package/dist/mutations/organization/set-active-organization-mutation.d.ts +71 -0
- package/dist/mutations/organization/set-active-organization-mutation.js +72 -0
- package/dist/mutations/organization/update-member-role-mutation.d.ts +31 -0
- package/dist/mutations/organization/update-member-role-mutation.js +36 -0
- package/dist/mutations/organization/update-organization-mutation.d.ts +21 -0
- package/dist/mutations/organization/update-organization-mutation.js +36 -0
- package/dist/mutations/passkey/add-passkey-mutation.d.ts +16 -16
- package/dist/mutations/passkey/add-passkey-mutation.js +38 -27
- package/dist/mutations/passkey/delete-passkey-mutation.d.ts +8 -8
- package/dist/mutations/passkey/delete-passkey-mutation.js +37 -27
- package/dist/mutations/passkey/sign-in-passkey-mutation.d.ts +24 -24
- package/dist/mutations/passkey/sign-in-passkey-mutation.js +36 -27
- package/dist/mutations/settings/change-email-mutation.d.ts +9 -8
- package/dist/mutations/settings/change-email-mutation.js +35 -27
- package/dist/mutations/settings/change-password-mutation.d.ts +6 -6
- package/dist/mutations/settings/change-password-mutation.js +31 -22
- package/dist/mutations/settings/delete-user-mutation.d.ts +4 -4
- package/dist/mutations/settings/delete-user-mutation.js +31 -22
- package/dist/mutations/settings/link-social-mutation.d.ts +4 -4
- package/dist/mutations/settings/link-social-mutation.js +31 -22
- package/dist/mutations/settings/revoke-session-mutation.d.ts +8 -8
- package/dist/mutations/settings/revoke-session-mutation.js +37 -27
- package/dist/mutations/settings/unlink-account-mutation.d.ts +8 -8
- package/dist/mutations/settings/unlink-account-mutation.js +37 -27
- package/dist/mutations/settings/update-user-mutation.d.ts +8 -8
- package/dist/mutations/settings/update-user-mutation.js +34 -33
- package/dist/mutations/username/is-username-available-mutation.d.ts +4 -4
- package/dist/mutations/username/is-username-available-mutation.js +34 -22
- package/dist/mutations/username/sign-in-username-mutation.d.ts +10 -10
- package/dist/mutations/username/sign-in-username-mutation.js +35 -27
- package/dist/plugins/captcha-plugin.d.ts +3 -3
- package/dist/plugins/captcha-plugin.js +31 -26
- package/dist/plugins.d.ts +1 -1
- package/dist/plugins.js +1 -2
- package/dist/queries/api-key/list-api-keys-query.d.ts +20 -11
- package/dist/queries/api-key/list-api-keys-query.js +52 -29
- package/dist/queries/auth/session-query.d.ts +6 -6
- package/dist/queries/auth/session-query.js +70 -28
- package/dist/queries/auth-query-options.d.ts +2 -2
- package/dist/queries/auth-query-options.js +20 -16
- package/dist/queries/multi-session/list-device-sessions-query.d.ts +8 -8
- package/dist/queries/multi-session/list-device-sessions-query.js +83 -29
- package/dist/queries/organization/active-organization-query.d.ts +39 -0
- package/dist/queries/organization/active-organization-query.js +37 -0
- package/dist/queries/organization/full-organization-query.d.ts +37 -0
- package/dist/queries/organization/full-organization-query.js +31 -0
- package/dist/queries/organization/has-permission-query.d.ts +21 -0
- package/dist/queries/organization/has-permission-query.js +38 -0
- package/dist/queries/organization/index.d.ts +7 -0
- package/dist/queries/organization/index.js +7 -0
- package/dist/queries/organization/list-invitations-query.d.ts +29 -0
- package/dist/queries/organization/list-invitations-query.js +37 -0
- package/dist/queries/organization/list-members-query.d.ts +61 -0
- package/dist/queries/organization/list-members-query.js +37 -0
- package/dist/queries/organization/list-organizations-query.d.ts +22 -0
- package/dist/queries/organization/list-organizations-query.js +31 -0
- package/dist/queries/organization/list-user-invitations-query.d.ts +29 -0
- package/dist/queries/organization/list-user-invitations-query.js +31 -0
- package/dist/queries/passkey/list-passkeys-query.d.ts +8 -8
- package/dist/queries/passkey/list-passkeys-query.js +81 -29
- package/dist/queries/settings/account-info-query.d.ts +6 -6
- package/dist/queries/settings/account-info-query.js +85 -29
- package/dist/queries/settings/list-accounts-query.d.ts +6 -6
- package/dist/queries/settings/list-accounts-query.js +83 -29
- package/dist/queries/settings/list-sessions-query.d.ts +6 -6
- package/dist/queries/settings/list-sessions-query.js +81 -29
- package/dist/server/queries/api-key/list-api-keys-query.d.ts +83 -0
- package/dist/server/queries/api-key/list-api-keys-query.js +49 -0
- package/dist/server/queries/auth/session-query.d.ts +5 -5
- package/dist/server/queries/auth/session-query.js +50 -12
- package/dist/server/queries/multi-session/list-device-sessions-query.d.ts +7 -7
- package/dist/server/queries/multi-session/list-device-sessions-query.js +53 -11
- package/dist/server/queries/organization/active-organization-query.d.ts +61 -0
- package/dist/server/queries/organization/active-organization-query.js +25 -0
- package/dist/server/queries/organization/full-organization-query.d.ts +42 -0
- package/dist/server/queries/organization/full-organization-query.js +21 -0
- package/dist/server/queries/organization/has-permission-query.d.ts +66 -0
- package/dist/server/queries/organization/has-permission-query.js +23 -0
- package/dist/server/queries/organization/list-invitations-query.d.ts +34 -0
- package/dist/server/queries/organization/list-invitations-query.js +21 -0
- package/dist/server/queries/organization/list-members-query.d.ts +66 -0
- package/dist/server/queries/organization/list-members-query.js +21 -0
- package/dist/server/queries/organization/list-organizations-query.d.ts +27 -0
- package/dist/server/queries/organization/list-organizations-query.js +21 -0
- package/dist/server/queries/organization/list-user-invitations-query.d.ts +34 -0
- package/dist/server/queries/organization/list-user-invitations-query.js +21 -0
- package/dist/server/queries/passkey/list-passkeys-query.d.ts +7 -7
- package/dist/server/queries/passkey/list-passkeys-query.js +53 -11
- package/dist/server/queries/settings/account-info-query.d.ts +5 -5
- package/dist/server/queries/settings/account-info-query.js +53 -11
- package/dist/server/queries/settings/list-accounts-query.d.ts +5 -5
- package/dist/server/queries/settings/list-accounts-query.js +53 -11
- package/dist/server/queries/settings/list-sessions-query.d.ts +5 -5
- package/dist/server/queries/settings/list-sessions-query.js +53 -11
- package/dist/server.d.ts +15 -7
- package/dist/server.js +14 -7
- package/package.json +20 -17
- package/src/components/auth/auth-context.tsx +7 -0
- package/src/components/auth/auth-provider.tsx +19 -31
- package/src/components/auth/email/email-localization.tsx +5 -3
- package/src/components/auth/email/index.ts +1 -0
- package/src/components/auth/email/organization-invitation.tsx +454 -0
- package/src/components/mutation-invalidator.tsx +67 -0
- package/src/index.ts +3 -0
- package/src/lib/auth-client.ts +7 -0
- package/src/lib/auth-plugin.ts +17 -0
- package/src/lib/auth-server.ts +17 -1
- package/src/lib/settings-tab.ts +21 -0
- package/src/mutations/api-key/create-api-key-mutation.ts +34 -19
- package/src/mutations/api-key/delete-api-key-mutation.ts +36 -19
- package/src/mutations/auth/sign-in-email-mutation.ts +18 -22
- package/src/mutations/auth/sign-out-mutation.ts +19 -13
- package/src/mutations/auth/sign-up-email-mutation.ts +18 -22
- package/src/mutations/multi-session/revoke-multi-session-mutation.ts +31 -20
- package/src/mutations/multi-session/set-active-session-mutation.ts +25 -44
- package/src/mutations/organization/accept-invitation-mutation.ts +71 -0
- package/src/mutations/organization/cancel-invitation-mutation.ts +67 -0
- package/src/mutations/organization/check-slug-mutation.ts +55 -0
- package/src/mutations/organization/create-organization-mutation.ts +71 -0
- package/src/mutations/organization/delete-organization-mutation.ts +71 -0
- package/src/mutations/organization/index.ts +12 -0
- package/src/mutations/organization/invite-member-mutation.ts +81 -0
- package/src/mutations/organization/leave-organization-mutation.ts +74 -0
- package/src/mutations/organization/reject-invitation-mutation.ts +64 -0
- package/src/mutations/organization/remove-member-mutation.ts +67 -0
- package/src/mutations/organization/set-active-organization-mutation.ts +142 -0
- package/src/mutations/organization/update-member-role-mutation.ts +81 -0
- package/src/mutations/organization/update-organization-mutation.ts +84 -0
- package/src/mutations/passkey/add-passkey-mutation.ts +28 -17
- package/src/mutations/passkey/delete-passkey-mutation.ts +27 -17
- package/src/mutations/passkey/sign-in-passkey-mutation.ts +18 -21
- package/src/mutations/settings/change-email-mutation.ts +22 -18
- package/src/mutations/settings/delete-user-mutation.ts +2 -2
- package/src/mutations/settings/revoke-session-mutation.ts +24 -19
- package/src/mutations/settings/unlink-account-mutation.ts +24 -17
- package/src/mutations/settings/update-user-mutation.ts +18 -30
- package/src/mutations/username/is-username-available-mutation.ts +2 -2
- package/src/mutations/username/sign-in-username-mutation.ts +20 -23
- package/src/queries/api-key/list-api-keys-query.ts +20 -8
- package/src/queries/multi-session/list-device-sessions-query.ts +2 -2
- package/src/queries/organization/active-organization-query.ts +140 -0
- package/src/queries/organization/full-organization-query.ts +113 -0
- package/src/queries/organization/has-permission-query.ts +124 -0
- package/src/queries/organization/index.ts +7 -0
- package/src/queries/organization/list-invitations-query.ts +133 -0
- package/src/queries/organization/list-members-query.ts +133 -0
- package/src/queries/organization/list-organizations-query.ts +122 -0
- package/src/queries/organization/list-user-invitations-query.ts +122 -0
- package/src/queries/passkey/list-passkeys-query.ts +2 -2
- package/src/server/queries/api-key/list-api-keys-query.ts +94 -0
- package/src/server/queries/multi-session/list-device-sessions-query.ts +2 -2
- package/src/server/queries/organization/active-organization-query.ts +92 -0
- package/src/server/queries/organization/full-organization-query.ts +64 -0
- package/src/server/queries/organization/has-permission-query.ts +66 -0
- package/src/server/queries/organization/list-invitations-query.ts +81 -0
- package/src/server/queries/organization/list-members-query.ts +75 -0
- package/src/server/queries/organization/list-organizations-query.ts +67 -0
- package/src/server/queries/organization/list-user-invitations-query.ts +68 -0
- package/src/server/queries/passkey/list-passkeys-query.ts +2 -2
- package/src/server.ts +8 -0
|
@@ -1,129 +1,65 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
|
|
15
|
-
}, y = ({ verificationCode: v, email: b, appName: x, expirationMinutes: S = 10, logoURL: C, colors: w, classNames: T, darkMode: E = !0, poweredBy: D, head: O, ...k }) => {
|
|
16
|
-
let A = {
|
|
17
|
-
...y.localization,
|
|
18
|
-
...k.localization
|
|
19
|
-
}, j = A.YOUR_VERIFICATION_CODE_IS_CODE.replace("{verificationCode}", v);
|
|
20
|
-
return /* @__PURE__ */ i(u, { children: [
|
|
21
|
-
/* @__PURE__ */ i(s, { children: [
|
|
22
|
-
/* @__PURE__ */ r("meta", {
|
|
23
|
-
content: "light dark",
|
|
24
|
-
name: "color-scheme"
|
|
25
|
-
}),
|
|
26
|
-
/* @__PURE__ */ r("meta", {
|
|
27
|
-
content: "light dark",
|
|
28
|
-
name: "supported-color-schemes"
|
|
29
|
-
}),
|
|
30
|
-
/* @__PURE__ */ r(t, {
|
|
31
|
-
colors: w,
|
|
32
|
-
darkMode: E
|
|
33
|
-
}),
|
|
34
|
-
O
|
|
35
|
-
] }),
|
|
36
|
-
/* @__PURE__ */ r(p, { children: j }),
|
|
37
|
-
/* @__PURE__ */ r(h, {
|
|
38
|
-
config: { presets: [_] },
|
|
39
|
-
children: /* @__PURE__ */ r(a, {
|
|
40
|
-
className: e("bg-background font-sans", T?.body),
|
|
41
|
-
children: /* @__PURE__ */ r(o, {
|
|
42
|
-
className: e("mx-auto my-auto max-w-xl px-2 py-10", T?.container),
|
|
43
|
-
children: /* @__PURE__ */ i(m, {
|
|
44
|
-
className: e("bg-card text-card-foreground rounded-none border border-border p-8", T?.card),
|
|
45
|
-
children: [
|
|
46
|
-
C && (typeof C == "string" ? /* @__PURE__ */ r(d, {
|
|
47
|
-
src: C,
|
|
48
|
-
width: 48,
|
|
49
|
-
height: 48,
|
|
50
|
-
alt: x || A.LOGO,
|
|
51
|
-
className: e("mx-auto mb-8", T?.logo)
|
|
52
|
-
}) : /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(d, {
|
|
53
|
-
src: C.light,
|
|
54
|
-
width: 48,
|
|
55
|
-
height: 48,
|
|
56
|
-
alt: x || A.LOGO,
|
|
57
|
-
className: e("mx-auto mb-8 logo-light", T?.logo)
|
|
58
|
-
}), /* @__PURE__ */ r(d, {
|
|
59
|
-
src: C.dark,
|
|
60
|
-
width: 48,
|
|
61
|
-
height: 48,
|
|
62
|
-
alt: x || A.LOGO,
|
|
63
|
-
className: e("hidden mx-auto mb-8 logo-dark", T?.logo)
|
|
64
|
-
})] })),
|
|
65
|
-
/* @__PURE__ */ r(c, {
|
|
66
|
-
className: e("mb-5 text-2xl font-semibold", T?.title),
|
|
67
|
-
children: A.VERIFY_YOUR_EMAIL
|
|
68
|
-
}),
|
|
69
|
-
/* @__PURE__ */ r(g, {
|
|
70
|
-
className: e("text-sm font-normal", T?.content),
|
|
71
|
-
children: (() => {
|
|
72
|
-
let e = A.WE_NEED_TO_VERIFY_YOUR_EMAIL_ADDRESS.replace("{appName}", x || "").replace(/\s{2,}/g, " ").replace(" .", "."), [t, a] = e.split("{email}");
|
|
73
|
-
return b ? /* @__PURE__ */ i(n, { children: [
|
|
74
|
-
t,
|
|
75
|
-
/* @__PURE__ */ r(f, {
|
|
76
|
-
href: `mailto:${b}`,
|
|
77
|
-
className: "text-primary font-medium",
|
|
78
|
-
children: b
|
|
79
|
-
}),
|
|
80
|
-
a
|
|
81
|
-
] }) : e.replace("{email}", "").replace(/\s{2,}/g, " ").replace(" .", ".");
|
|
82
|
-
})()
|
|
83
|
-
}),
|
|
84
|
-
/* @__PURE__ */ r(m, {
|
|
85
|
-
className: e("my-6 border border-border bg-muted p-6", T?.codeBlock),
|
|
86
|
-
children: /* @__PURE__ */ r(g, {
|
|
87
|
-
className: e("m-0 text-center text-4xl font-semibold tracking-widest", T?.title),
|
|
88
|
-
children: v
|
|
89
|
-
})
|
|
90
|
-
}),
|
|
91
|
-
/* @__PURE__ */ r(l, { className: e("my-6 w-full border border-solid border-border", T?.separator) }),
|
|
92
|
-
/* @__PURE__ */ i(g, {
|
|
93
|
-
className: e("mb-3 text-xs text-muted-foreground", T?.description),
|
|
94
|
-
children: [A.THIS_CODE_EXPIRES_IN_MINUTES.replace("{expirationMinutes}", S.toString()), x && /* @__PURE__ */ i(n, { children: [" ", A.EMAIL_SENT_BY.replace("{appName}", x)] })]
|
|
95
|
-
}),
|
|
96
|
-
/* @__PURE__ */ r(g, {
|
|
97
|
-
className: e("mt-3 text-xs text-muted-foreground", T?.description),
|
|
98
|
-
children: A.IF_YOU_DIDNT_REQUEST_THIS_EMAIL
|
|
99
|
-
}),
|
|
100
|
-
D && /* @__PURE__ */ r(g, {
|
|
101
|
-
className: e("mt-4 mb-0 text-center text-[11px] text-muted-foreground", T?.poweredBy),
|
|
102
|
-
children: (() => {
|
|
103
|
-
let [t, a] = A.POWERED_BY_BETTER_AUTH.split("{betterAuth}");
|
|
104
|
-
return /* @__PURE__ */ i(n, { children: [
|
|
105
|
-
t,
|
|
106
|
-
/* @__PURE__ */ r(f, {
|
|
107
|
-
href: "https://better-auth.com",
|
|
108
|
-
className: e("text-primary underline", T?.link),
|
|
109
|
-
children: "better-auth"
|
|
110
|
-
}),
|
|
111
|
-
a
|
|
112
|
-
] });
|
|
113
|
-
})()
|
|
114
|
-
})
|
|
115
|
-
]
|
|
116
|
-
})
|
|
117
|
-
})
|
|
118
|
-
})
|
|
119
|
-
})
|
|
120
|
-
] });
|
|
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}"
|
|
121
14
|
};
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
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
|
+
})() }))] }) }) }) })] }));
|
|
127
57
|
};
|
|
128
|
-
|
|
129
|
-
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from
|
|
2
|
-
import { EmailClassNames, EmailColors } from
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type EmailClassNames, type EmailColors } from "./email-styles";
|
|
3
3
|
declare const passwordChangedEmailLocalization: {
|
|
4
4
|
YOUR_PASSWORD_HAS_BEEN_CHANGED: string;
|
|
5
5
|
LOGO: string;
|
|
@@ -1,159 +1,76 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
|
|
17
|
-
}, b = ({ email: y, timestamp: x, secureAccountURL: S, appName: C, supportEmail: w, logoURL: T, colors: E, classNames: D, darkMode: O = !0, poweredBy: k, head: A, ...j }) => {
|
|
18
|
-
let M = {
|
|
19
|
-
...b.localization,
|
|
20
|
-
...j.localization
|
|
21
|
-
}, N = M.YOUR_PASSWORD_HAS_BEEN_CHANGED;
|
|
22
|
-
return /* @__PURE__ */ i(d, { children: [
|
|
23
|
-
/* @__PURE__ */ i(c, { children: [
|
|
24
|
-
/* @__PURE__ */ r("meta", {
|
|
25
|
-
content: "light dark",
|
|
26
|
-
name: "color-scheme"
|
|
27
|
-
}),
|
|
28
|
-
/* @__PURE__ */ r("meta", {
|
|
29
|
-
content: "light dark",
|
|
30
|
-
name: "supported-color-schemes"
|
|
31
|
-
}),
|
|
32
|
-
/* @__PURE__ */ r(t, {
|
|
33
|
-
colors: E,
|
|
34
|
-
darkMode: O
|
|
35
|
-
}),
|
|
36
|
-
A
|
|
37
|
-
] }),
|
|
38
|
-
/* @__PURE__ */ r(m, { children: N }),
|
|
39
|
-
/* @__PURE__ */ r(g, {
|
|
40
|
-
config: { presets: [v] },
|
|
41
|
-
children: /* @__PURE__ */ r(a, {
|
|
42
|
-
className: e("bg-background font-sans", D?.body),
|
|
43
|
-
children: /* @__PURE__ */ r(s, {
|
|
44
|
-
className: e("mx-auto my-auto max-w-xl px-2 py-10", D?.container),
|
|
45
|
-
children: /* @__PURE__ */ i(h, {
|
|
46
|
-
className: e("bg-card text-card-foreground rounded-none border border-border p-8", D?.card),
|
|
47
|
-
children: [
|
|
48
|
-
T && (typeof T == "string" ? /* @__PURE__ */ r(f, {
|
|
49
|
-
src: T,
|
|
50
|
-
width: 48,
|
|
51
|
-
height: 48,
|
|
52
|
-
alt: C || M.LOGO,
|
|
53
|
-
className: e("mx-auto mb-8", D?.logo)
|
|
54
|
-
}) : /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(f, {
|
|
55
|
-
src: T.light,
|
|
56
|
-
width: 48,
|
|
57
|
-
height: 48,
|
|
58
|
-
alt: C || M.LOGO,
|
|
59
|
-
className: e("mx-auto mb-8 logo-light", D?.logo)
|
|
60
|
-
}), /* @__PURE__ */ r(f, {
|
|
61
|
-
src: T.dark,
|
|
62
|
-
width: 48,
|
|
63
|
-
height: 48,
|
|
64
|
-
alt: C || M.LOGO,
|
|
65
|
-
className: e("hidden mx-auto mb-8 logo-dark", D?.logo)
|
|
66
|
-
})] })),
|
|
67
|
-
/* @__PURE__ */ r(l, {
|
|
68
|
-
className: e("m-0 mb-5 text-2xl font-semibold", D?.title),
|
|
69
|
-
children: M.PASSWORD_CHANGED_SUCCESSFULLY
|
|
70
|
-
}),
|
|
71
|
-
/* @__PURE__ */ r(_, {
|
|
72
|
-
className: e("text-sm font-normal", D?.content),
|
|
73
|
-
children: (() => {
|
|
74
|
-
let e = M.PASSWORD_FOR_YOUR_ACCOUNT_CHANGED.replace("{appName}", C || "").replace(/\s{2,}/g, " ").replace(" .", "."), [t, a] = e.split("{userEmail}");
|
|
75
|
-
return y ? /* @__PURE__ */ i(n, { children: [
|
|
76
|
-
t,
|
|
77
|
-
/* @__PURE__ */ r(p, {
|
|
78
|
-
href: `mailto:${y}`,
|
|
79
|
-
className: "text-primary font-medium",
|
|
80
|
-
children: y
|
|
81
|
-
}),
|
|
82
|
-
a
|
|
83
|
-
] }) : e.replace("{userEmail}", "").replace(/\s{2,}/g, " ").replace(" .", ".");
|
|
84
|
-
})()
|
|
85
|
-
}),
|
|
86
|
-
x && /* @__PURE__ */ i(h, {
|
|
87
|
-
className: e("my-6 border border-border bg-muted p-4", D?.codeBlock),
|
|
88
|
-
children: [/* @__PURE__ */ i(_, {
|
|
89
|
-
className: e("m-0 mb-2 text-xs text-muted-foreground", D?.description),
|
|
90
|
-
children: [M.CHANGED_AT, ":"]
|
|
91
|
-
}), /* @__PURE__ */ r(_, {
|
|
92
|
-
className: e("m-0 text-sm font-semibold", D?.content),
|
|
93
|
-
children: x
|
|
94
|
-
})]
|
|
95
|
-
}),
|
|
96
|
-
/* @__PURE__ */ r(_, {
|
|
97
|
-
className: e("text-sm font-normal", D?.content),
|
|
98
|
-
children: M.IF_YOU_MADE_THIS_CHANGE
|
|
99
|
-
}),
|
|
100
|
-
S && /* @__PURE__ */ r(h, {
|
|
101
|
-
className: "mt-6",
|
|
102
|
-
children: /* @__PURE__ */ r(o, {
|
|
103
|
-
href: S,
|
|
104
|
-
className: e("inline-block whitespace-nowrap rounded-none text-sm font-medium py-2.5 px-6 bg-primary text-primary-foreground no-underline", D?.button),
|
|
105
|
-
children: M.I_DIDNT_MAKE_THIS_CHANGE
|
|
106
|
-
})
|
|
107
|
-
}),
|
|
108
|
-
/* @__PURE__ */ r(u, { className: e("my-6 w-full border border-solid border-border", D?.separator) }),
|
|
109
|
-
C && /* @__PURE__ */ r(_, {
|
|
110
|
-
className: e("mb-3 text-xs text-muted-foreground", D?.description),
|
|
111
|
-
children: M.EMAIL_SENT_BY.replace("{appName}", C)
|
|
112
|
-
}),
|
|
113
|
-
/* @__PURE__ */ r(_, {
|
|
114
|
-
className: e("mt-3 text-xs text-muted-foreground", D?.description),
|
|
115
|
-
children: (() => {
|
|
116
|
-
let [t, a] = M.IF_YOU_DIDNT_AUTHORIZE_THIS_CHANGE.split("{supportEmail}");
|
|
117
|
-
return w ? /* @__PURE__ */ i(n, { children: [
|
|
118
|
-
t,
|
|
119
|
-
/* @__PURE__ */ r(p, {
|
|
120
|
-
href: `mailto:${w}`,
|
|
121
|
-
className: e("text-primary underline", D?.link),
|
|
122
|
-
children: w
|
|
123
|
-
}),
|
|
124
|
-
a
|
|
125
|
-
] }) : M.IF_YOU_DIDNT_AUTHORIZE_THIS_CHANGE.replace("{supportEmail}", "").replace(/\s{2,}/g, " ").replace(" .", ".");
|
|
126
|
-
})()
|
|
127
|
-
}),
|
|
128
|
-
k && /* @__PURE__ */ r(_, {
|
|
129
|
-
className: e("mt-4 mb-0 text-center text-[11px] text-muted-foreground", D?.poweredBy),
|
|
130
|
-
children: (() => {
|
|
131
|
-
let [t, a] = M.POWERED_BY_BETTER_AUTH.split("{betterAuth}");
|
|
132
|
-
return /* @__PURE__ */ i(n, { children: [
|
|
133
|
-
t,
|
|
134
|
-
/* @__PURE__ */ r(p, {
|
|
135
|
-
href: "https://better-auth.com",
|
|
136
|
-
className: e("text-primary underline", D?.link),
|
|
137
|
-
children: "better-auth"
|
|
138
|
-
}),
|
|
139
|
-
a
|
|
140
|
-
] });
|
|
141
|
-
})()
|
|
142
|
-
})
|
|
143
|
-
]
|
|
144
|
-
})
|
|
145
|
-
})
|
|
146
|
-
})
|
|
147
|
-
})
|
|
148
|
-
] });
|
|
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}"
|
|
149
16
|
};
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
+
})() }))] }) }) }) })] }));
|
|
157
66
|
};
|
|
158
|
-
|
|
159
|
-
|
|
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,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from
|
|
2
|
-
import { EmailClassNames, EmailColors } from
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import { type EmailClassNames, type EmailColors } from "./email-styles";
|
|
3
3
|
declare const resetPasswordEmailLocalization: {
|
|
4
4
|
RESET_YOUR_PASSWORD: string;
|
|
5
5
|
LOGO: string;
|