@better-auth-ui/react 1.6.8 → 1.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/auth/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
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth-ui/react",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "
|
|
7
|
-
"dev": "tsc --watch",
|
|
6
|
+
"build": "tsc",
|
|
8
7
|
"email": "email dev --dir src/components/auth/email -p 9000",
|
|
9
8
|
"test": "vitest"
|
|
10
9
|
},
|
|
@@ -16,51 +15,55 @@
|
|
|
16
15
|
"types": "./dist/index.d.ts",
|
|
17
16
|
"exports": {
|
|
18
17
|
".": {
|
|
18
|
+
"development": "./src/index.ts",
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"import": "./dist/index.js"
|
|
21
21
|
},
|
|
22
22
|
"./email": {
|
|
23
|
+
"development": "./src/email.ts",
|
|
23
24
|
"types": "./dist/email.d.ts",
|
|
24
25
|
"import": "./dist/email.js"
|
|
25
26
|
},
|
|
26
27
|
"./server": {
|
|
28
|
+
"development": "./src/server.ts",
|
|
27
29
|
"types": "./dist/server.d.ts",
|
|
28
30
|
"import": "./dist/server.js"
|
|
29
31
|
},
|
|
30
32
|
"./plugins": {
|
|
33
|
+
"development": "./src/plugins.ts",
|
|
31
34
|
"types": "./dist/plugins.d.ts",
|
|
32
35
|
"import": "./dist/plugins.js"
|
|
33
36
|
}
|
|
34
37
|
},
|
|
35
38
|
"devDependencies": {
|
|
36
|
-
"@better-auth/api-key": "^1.6.
|
|
37
|
-
"@better-auth/passkey": "^1.6.
|
|
39
|
+
"@better-auth/api-key": "^1.6.11",
|
|
40
|
+
"@better-auth/passkey": "^1.6.11",
|
|
38
41
|
"@react-email/components": "^1.0.12",
|
|
39
42
|
"@react-email/preview-server": "^5.2.10",
|
|
40
|
-
"@tanstack/react-query": "^5.100.
|
|
43
|
+
"@tanstack/react-query": "^5.100.14",
|
|
41
44
|
"@testing-library/react": "^16.3.2",
|
|
42
45
|
"@testing-library/user-event": "^14.5.2",
|
|
43
|
-
"@types/react": "^19.2.
|
|
44
|
-
"@vitejs/plugin-react": "^6.0.
|
|
45
|
-
"@vitest/browser-playwright": "^4.1.
|
|
46
|
-
"better-auth": "^1.6.
|
|
46
|
+
"@types/react": "^19.2.15",
|
|
47
|
+
"@vitejs/plugin-react": "^6.0.2",
|
|
48
|
+
"@vitest/browser-playwright": "^4.1.7",
|
|
49
|
+
"better-auth": "^1.6.11",
|
|
47
50
|
"clsx": "^2.1.1",
|
|
48
|
-
"playwright": "^1.
|
|
51
|
+
"playwright": "^1.60.0",
|
|
49
52
|
"react": "^19.2.6",
|
|
50
53
|
"react-dom": "^19.2.6",
|
|
51
|
-
"react-email": "^6.
|
|
54
|
+
"react-email": "^6.4.0",
|
|
52
55
|
"tailwind-merge": "^3.5.0",
|
|
53
56
|
"tailwindcss": "^4.3.0",
|
|
54
|
-
"vitest": "^4.1.
|
|
57
|
+
"vitest": "^4.1.7",
|
|
55
58
|
"zod": "^4.4.3"
|
|
56
59
|
},
|
|
57
60
|
"peerDependencies": {
|
|
58
61
|
"@better-auth-ui/core": "*",
|
|
59
|
-
"@better-auth/api-key": ">=1.6.
|
|
60
|
-
"@better-auth/passkey": ">=1.6.
|
|
62
|
+
"@better-auth/api-key": ">=1.6.11",
|
|
63
|
+
"@better-auth/passkey": ">=1.6.11",
|
|
61
64
|
"@react-email/components": ">=1.0.12",
|
|
62
|
-
"@tanstack/react-query": ">=5.100.
|
|
63
|
-
"better-auth": ">=1.6.
|
|
65
|
+
"@tanstack/react-query": ">=5.100.14",
|
|
66
|
+
"better-auth": ">=1.6.11",
|
|
64
67
|
"clsx": ">=2.0.0",
|
|
65
68
|
"react": ">=19.2.6",
|
|
66
69
|
"react-dom": ">=19.2.6",
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import type { AuthConfig } from "@better-auth-ui/core"
|
|
4
|
+
import { createContext } from "react"
|
|
5
|
+
|
|
6
|
+
/** Split from `auth-provider` so HMR reloading that file does not replace this context instance. */
|
|
7
|
+
export const AuthContext = createContext<AuthConfig | undefined>(undefined)
|
|
@@ -12,17 +12,12 @@ import {
|
|
|
12
12
|
QueryClientContext,
|
|
13
13
|
QueryClientProvider
|
|
14
14
|
} from "@tanstack/react-query"
|
|
15
|
-
import {
|
|
16
|
-
createContext,
|
|
17
|
-
type PropsWithChildren,
|
|
18
|
-
type ReactNode,
|
|
19
|
-
useContext
|
|
20
|
-
} from "react"
|
|
15
|
+
import { type PropsWithChildren, type ReactNode, useContext } from "react"
|
|
21
16
|
import type { AuthClient } from "../../lib/auth-client"
|
|
17
|
+
import { MutationInvalidator } from "../mutation-invalidator"
|
|
18
|
+
import { AuthContext } from "./auth-context"
|
|
22
19
|
import { FetchOptionsProvider } from "./fetch-options-provider"
|
|
23
20
|
|
|
24
|
-
const AuthContext = createContext<AuthConfig | undefined>(undefined)
|
|
25
|
-
|
|
26
21
|
const fallbackQueryClient = new QueryClient({
|
|
27
22
|
defaultOptions: {
|
|
28
23
|
queries: {
|
|
@@ -70,19 +65,14 @@ export function AuthProvider({
|
|
|
70
65
|
queryClient,
|
|
71
66
|
...config
|
|
72
67
|
}: AuthProviderProps) {
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
...defaultAuthConfig.viewPaths.settings,
|
|
82
|
-
...config.viewPaths?.settings
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
} as AuthConfig)
|
|
68
|
+
const { authClient, ...partialConfig } = config
|
|
69
|
+
const mergedConfig = {
|
|
70
|
+
...deepmerge<Omit<AuthConfig, "authClient">>(
|
|
71
|
+
defaultAuthConfig,
|
|
72
|
+
partialConfig
|
|
73
|
+
),
|
|
74
|
+
authClient
|
|
75
|
+
}
|
|
86
76
|
|
|
87
77
|
mergedConfig.redirectTo =
|
|
88
78
|
(typeof window !== "undefined" &&
|
|
@@ -105,18 +95,16 @@ export function AuthProvider({
|
|
|
105
95
|
|
|
106
96
|
const contextQueryClient = useContext(QueryClientContext)
|
|
107
97
|
|
|
108
|
-
if (contextQueryClient) {
|
|
109
|
-
return (
|
|
110
|
-
<AuthContext.Provider value={mergedConfig}>
|
|
111
|
-
<FetchOptionsProvider>{children}</FetchOptionsProvider>
|
|
112
|
-
</AuthContext.Provider>
|
|
113
|
-
)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
98
|
return (
|
|
117
|
-
<QueryClientProvider
|
|
99
|
+
<QueryClientProvider
|
|
100
|
+
client={queryClient || contextQueryClient || fallbackQueryClient}
|
|
101
|
+
>
|
|
118
102
|
<AuthContext.Provider value={mergedConfig}>
|
|
119
|
-
<FetchOptionsProvider>
|
|
103
|
+
<FetchOptionsProvider>
|
|
104
|
+
<MutationInvalidator />
|
|
105
|
+
|
|
106
|
+
{children}
|
|
107
|
+
</FetchOptionsProvider>
|
|
120
108
|
</AuthContext.Provider>
|
|
121
109
|
</QueryClientProvider>
|
|
122
110
|
)
|
|
@@ -2,6 +2,7 @@ import EmailChangedEmail from "./email-changed"
|
|
|
2
2
|
import EmailVerificationEmail from "./email-verification"
|
|
3
3
|
import MagicLinkEmail from "./magic-link"
|
|
4
4
|
import NewDeviceEmail from "./new-device"
|
|
5
|
+
import OrganizationInvitationEmail from "./organization-invitation"
|
|
5
6
|
import OtpEmail from "./otp-email"
|
|
6
7
|
import PasswordChangedEmail from "./password-changed"
|
|
7
8
|
import ResetPasswordEmail from "./reset-password"
|
|
@@ -10,15 +11,16 @@ import ResetPasswordEmail from "./reset-password"
|
|
|
10
11
|
* Aggregated localization strings for all email components.
|
|
11
12
|
*
|
|
12
13
|
* Combines localization strings from all email templates (EmailChangedEmail,
|
|
13
|
-
* EmailVerificationEmail, MagicLinkEmail, NewDeviceEmail,
|
|
14
|
-
*
|
|
15
|
-
* bulk customization.
|
|
14
|
+
* EmailVerificationEmail, MagicLinkEmail, NewDeviceEmail,
|
|
15
|
+
* OrganizationInvitationEmail, OtpEmail, PasswordChangedEmail,
|
|
16
|
+
* ResetPasswordEmail) into a single object for convenient bulk customization.
|
|
16
17
|
*/
|
|
17
18
|
export const emailLocalization = {
|
|
18
19
|
...EmailChangedEmail.localization,
|
|
19
20
|
...EmailVerificationEmail.localization,
|
|
20
21
|
...MagicLinkEmail.localization,
|
|
21
22
|
...NewDeviceEmail.localization,
|
|
23
|
+
...OrganizationInvitationEmail.localization,
|
|
22
24
|
...OtpEmail.localization,
|
|
23
25
|
...PasswordChangedEmail.localization,
|
|
24
26
|
...ResetPasswordEmail.localization
|
|
@@ -4,6 +4,7 @@ export * from "./email-styles"
|
|
|
4
4
|
export * from "./email-verification"
|
|
5
5
|
export * from "./magic-link"
|
|
6
6
|
export * from "./new-device"
|
|
7
|
+
export * from "./organization-invitation"
|
|
7
8
|
export * from "./otp-email"
|
|
8
9
|
export * from "./password-changed"
|
|
9
10
|
export * from "./reset-password"
|
|
@@ -0,0 +1,454 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Body,
|
|
3
|
+
Button,
|
|
4
|
+
Container,
|
|
5
|
+
Head,
|
|
6
|
+
Heading,
|
|
7
|
+
Hr,
|
|
8
|
+
Html,
|
|
9
|
+
Img,
|
|
10
|
+
Link,
|
|
11
|
+
Preview,
|
|
12
|
+
pixelBasedPreset,
|
|
13
|
+
Section,
|
|
14
|
+
Tailwind,
|
|
15
|
+
Text
|
|
16
|
+
} from "@react-email/components"
|
|
17
|
+
import type { ReactNode } from "react"
|
|
18
|
+
|
|
19
|
+
import { cn } from "../../../lib/utils"
|
|
20
|
+
import {
|
|
21
|
+
type EmailClassNames,
|
|
22
|
+
type EmailColors,
|
|
23
|
+
EmailStyles
|
|
24
|
+
} from "./email-styles"
|
|
25
|
+
|
|
26
|
+
const organizationInvitationEmailLocalization = {
|
|
27
|
+
YOU_RE_INVITED_TO_ORGANIZATION: "You're invited to {organizationName}",
|
|
28
|
+
YOU_RE_INVITED: "You're invited",
|
|
29
|
+
LOGO: "Logo",
|
|
30
|
+
ORGANIZATION_LOGO: "Organization logo",
|
|
31
|
+
INVITED_TO_JOIN_ORGANIZATION:
|
|
32
|
+
"{inviterName} ({inviterEmail}) has invited you to join {organizationName} on {appName} as a {role}.",
|
|
33
|
+
ACCEPT_INVITATION: "Accept invitation",
|
|
34
|
+
VIEW_INVITATION: "View invitation",
|
|
35
|
+
OR_COPY_AND_PASTE_URL: "Or copy and paste this URL into your browser:",
|
|
36
|
+
THIS_INVITATION_EXPIRES_IN_HOURS:
|
|
37
|
+
"This invitation expires in {expirationHours} hours.",
|
|
38
|
+
EMAIL_SENT_BY: "Email sent by {appName}.",
|
|
39
|
+
IF_YOU_DIDNT_EXPECT_THIS_INVITATION:
|
|
40
|
+
"If you didn't expect this invitation, you can safely ignore this email.",
|
|
41
|
+
POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Localization strings for the OrganizationInvitationEmail component.
|
|
46
|
+
*
|
|
47
|
+
* Contains all text content used in the organization invitation email template.
|
|
48
|
+
*/
|
|
49
|
+
export type OrganizationInvitationEmailLocalization =
|
|
50
|
+
typeof organizationInvitationEmailLocalization
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Props for the OrganizationInvitationEmail component.
|
|
54
|
+
*/
|
|
55
|
+
export interface OrganizationInvitationEmailProps {
|
|
56
|
+
/**
|
|
57
|
+
* URL where the invitee can review and accept the invitation.
|
|
58
|
+
*
|
|
59
|
+
* @remarks Pass `{baseUrl}/settings/organizations` — this is where pending
|
|
60
|
+
* organization invitations are listed in the settings UI.
|
|
61
|
+
*/
|
|
62
|
+
url: string
|
|
63
|
+
/** Email address of the user being invited */
|
|
64
|
+
email?: string
|
|
65
|
+
/** Name of the person who sent the invitation */
|
|
66
|
+
inviterName?: string
|
|
67
|
+
/** Email address of the person who sent the invitation */
|
|
68
|
+
inviterEmail?: string
|
|
69
|
+
/** Name of the organization the user is being invited to */
|
|
70
|
+
organizationName?: string
|
|
71
|
+
/** Organization logo URL(s) - a single string or light/dark variants. */
|
|
72
|
+
organizationLogoURL?: string | { light: string; dark: string }
|
|
73
|
+
/** Role being offered to the invitee (e.g. "member", "admin", "owner") */
|
|
74
|
+
role?: string
|
|
75
|
+
/** Name of the application sending the email */
|
|
76
|
+
appName?: string
|
|
77
|
+
/** Number of hours until the invitation expires */
|
|
78
|
+
expirationHours?: number
|
|
79
|
+
/** Logo URL(s) - a single string or light/dark variants. If omitted, no logo is shown. */
|
|
80
|
+
logoURL?: string | { light: string; dark: string }
|
|
81
|
+
/** Custom CSS class names for styling specific parts of the email */
|
|
82
|
+
classNames?: EmailClassNames
|
|
83
|
+
/** Custom color scheme for light and dark modes */
|
|
84
|
+
colors?: EmailColors
|
|
85
|
+
/** Whether to show the "Powered by better-auth" footer */
|
|
86
|
+
poweredBy?: boolean
|
|
87
|
+
/** Whether to enable dark mode support */
|
|
88
|
+
darkMode?: boolean
|
|
89
|
+
/** Additional React nodes to inject into the email head */
|
|
90
|
+
head?: ReactNode
|
|
91
|
+
/**
|
|
92
|
+
* Localization overrides for customizing email text
|
|
93
|
+
* @remarks `OrganizationInvitationEmailLocalization`
|
|
94
|
+
*/
|
|
95
|
+
localization?: Partial<OrganizationInvitationEmailLocalization>
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Email template component that invites a user to join an organization.
|
|
100
|
+
*
|
|
101
|
+
* This email includes:
|
|
102
|
+
* - Inviter and organization details
|
|
103
|
+
* - Role being offered
|
|
104
|
+
* - Accept invitation button linking to `{baseUrl}/settings/organizations`
|
|
105
|
+
* - Fallback URL for manual copy/paste
|
|
106
|
+
* - Optional expiration time information
|
|
107
|
+
* - Security notice for unexpected invitations
|
|
108
|
+
* - Customizable branding and styling
|
|
109
|
+
* - Support for light/dark mode themes
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```tsx
|
|
113
|
+
* <OrganizationInvitationEmail
|
|
114
|
+
* url="https://example.com/settings/organizations"
|
|
115
|
+
* email="invitee@example.com"
|
|
116
|
+
* inviterName="Jane Doe"
|
|
117
|
+
* inviterEmail="jane@example.com"
|
|
118
|
+
* organizationName="Acme Inc."
|
|
119
|
+
* organizationLogoURL="https://example.com/acme-logo.png"
|
|
120
|
+
* role="member"
|
|
121
|
+
* appName="My App"
|
|
122
|
+
* expirationHours={48}
|
|
123
|
+
* darkMode={true}
|
|
124
|
+
* />
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
export const OrganizationInvitationEmail = ({
|
|
128
|
+
url,
|
|
129
|
+
email,
|
|
130
|
+
inviterName,
|
|
131
|
+
inviterEmail,
|
|
132
|
+
organizationName,
|
|
133
|
+
organizationLogoURL,
|
|
134
|
+
role,
|
|
135
|
+
appName,
|
|
136
|
+
expirationHours = 48,
|
|
137
|
+
logoURL,
|
|
138
|
+
colors,
|
|
139
|
+
classNames,
|
|
140
|
+
darkMode = true,
|
|
141
|
+
poweredBy,
|
|
142
|
+
head,
|
|
143
|
+
...props
|
|
144
|
+
}: OrganizationInvitationEmailProps) => {
|
|
145
|
+
const localization = {
|
|
146
|
+
...OrganizationInvitationEmail.localization,
|
|
147
|
+
...props.localization
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const previewText = organizationName
|
|
151
|
+
? localization.YOU_RE_INVITED_TO_ORGANIZATION.replace(
|
|
152
|
+
"{organizationName}",
|
|
153
|
+
organizationName
|
|
154
|
+
)
|
|
155
|
+
: localization.YOU_RE_INVITED
|
|
156
|
+
|
|
157
|
+
return (
|
|
158
|
+
<Html>
|
|
159
|
+
<Head>
|
|
160
|
+
<meta content="light dark" name="color-scheme" />
|
|
161
|
+
<meta content="light dark" name="supported-color-schemes" />
|
|
162
|
+
|
|
163
|
+
<EmailStyles colors={colors} darkMode={darkMode} />
|
|
164
|
+
|
|
165
|
+
{head}
|
|
166
|
+
</Head>
|
|
167
|
+
|
|
168
|
+
<Preview>{previewText}</Preview>
|
|
169
|
+
|
|
170
|
+
<Tailwind config={{ presets: [pixelBasedPreset] }}>
|
|
171
|
+
<Body className={cn("bg-background font-sans", classNames?.body)}>
|
|
172
|
+
<Container
|
|
173
|
+
className={cn(
|
|
174
|
+
"mx-auto my-auto max-w-xl px-2 py-10",
|
|
175
|
+
classNames?.container
|
|
176
|
+
)}
|
|
177
|
+
>
|
|
178
|
+
<Section
|
|
179
|
+
className={cn(
|
|
180
|
+
"bg-card text-card-foreground rounded-none border border-border p-8",
|
|
181
|
+
classNames?.card
|
|
182
|
+
)}
|
|
183
|
+
>
|
|
184
|
+
{logoURL &&
|
|
185
|
+
(typeof logoURL === "string" ? (
|
|
186
|
+
<Img
|
|
187
|
+
src={logoURL}
|
|
188
|
+
width={48}
|
|
189
|
+
height={48}
|
|
190
|
+
alt={appName || localization.LOGO}
|
|
191
|
+
className={cn("mx-auto mb-8", classNames?.logo)}
|
|
192
|
+
/>
|
|
193
|
+
) : (
|
|
194
|
+
<>
|
|
195
|
+
<Img
|
|
196
|
+
src={logoURL.light}
|
|
197
|
+
width={48}
|
|
198
|
+
height={48}
|
|
199
|
+
alt={appName || localization.LOGO}
|
|
200
|
+
className={cn(
|
|
201
|
+
"mx-auto mb-8 logo-light",
|
|
202
|
+
classNames?.logo
|
|
203
|
+
)}
|
|
204
|
+
/>
|
|
205
|
+
<Img
|
|
206
|
+
src={logoURL.dark}
|
|
207
|
+
width={48}
|
|
208
|
+
height={48}
|
|
209
|
+
alt={appName || localization.LOGO}
|
|
210
|
+
className={cn(
|
|
211
|
+
"hidden mx-auto mb-8 logo-dark",
|
|
212
|
+
classNames?.logo
|
|
213
|
+
)}
|
|
214
|
+
/>
|
|
215
|
+
</>
|
|
216
|
+
))}
|
|
217
|
+
|
|
218
|
+
<Heading
|
|
219
|
+
className={cn(
|
|
220
|
+
"m-0 mb-5 text-2xl font-semibold",
|
|
221
|
+
classNames?.title
|
|
222
|
+
)}
|
|
223
|
+
>
|
|
224
|
+
{organizationName
|
|
225
|
+
? localization.YOU_RE_INVITED_TO_ORGANIZATION.replace(
|
|
226
|
+
"{organizationName}",
|
|
227
|
+
organizationName
|
|
228
|
+
)
|
|
229
|
+
: localization.YOU_RE_INVITED}
|
|
230
|
+
</Heading>
|
|
231
|
+
|
|
232
|
+
{organizationLogoURL &&
|
|
233
|
+
(typeof organizationLogoURL === "string" ? (
|
|
234
|
+
<Img
|
|
235
|
+
src={organizationLogoURL}
|
|
236
|
+
width={56}
|
|
237
|
+
height={56}
|
|
238
|
+
alt={organizationName || localization.ORGANIZATION_LOGO}
|
|
239
|
+
className={cn("mb-5 rounded-md", classNames?.logo)}
|
|
240
|
+
/>
|
|
241
|
+
) : (
|
|
242
|
+
<>
|
|
243
|
+
<Img
|
|
244
|
+
src={organizationLogoURL.light}
|
|
245
|
+
width={56}
|
|
246
|
+
height={56}
|
|
247
|
+
alt={organizationName || localization.ORGANIZATION_LOGO}
|
|
248
|
+
className={cn(
|
|
249
|
+
"mb-5 rounded-md logo-light",
|
|
250
|
+
classNames?.logo
|
|
251
|
+
)}
|
|
252
|
+
/>
|
|
253
|
+
<Img
|
|
254
|
+
src={organizationLogoURL.dark}
|
|
255
|
+
width={56}
|
|
256
|
+
height={56}
|
|
257
|
+
alt={organizationName || localization.ORGANIZATION_LOGO}
|
|
258
|
+
className={cn(
|
|
259
|
+
"hidden mb-5 rounded-md logo-dark",
|
|
260
|
+
classNames?.logo
|
|
261
|
+
)}
|
|
262
|
+
/>
|
|
263
|
+
</>
|
|
264
|
+
))}
|
|
265
|
+
|
|
266
|
+
<Text
|
|
267
|
+
className={cn("m-0 text-sm font-normal", classNames?.content)}
|
|
268
|
+
>
|
|
269
|
+
{(() => {
|
|
270
|
+
let text = localization.INVITED_TO_JOIN_ORGANIZATION.replace(
|
|
271
|
+
"{appName}",
|
|
272
|
+
appName || ""
|
|
273
|
+
)
|
|
274
|
+
.replace("{organizationName}", organizationName || "")
|
|
275
|
+
.replace("{role}", role || "")
|
|
276
|
+
|
|
277
|
+
// If we have no inviter info, drop the parenthetical and name placeholders cleanly.
|
|
278
|
+
if (!inviterName && !inviterEmail) {
|
|
279
|
+
text = text
|
|
280
|
+
.replace("{inviterName} ({inviterEmail})", "Someone")
|
|
281
|
+
.replace("{inviterName}", "Someone")
|
|
282
|
+
.replace("({inviterEmail})", "")
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
const [beforeInviterName, afterInviterName] =
|
|
286
|
+
text.split("{inviterName}")
|
|
287
|
+
|
|
288
|
+
const renderInviterEmail = (segment: string) => {
|
|
289
|
+
const [beforeInviterEmail, afterInviterEmail] =
|
|
290
|
+
segment.split("{inviterEmail}")
|
|
291
|
+
|
|
292
|
+
if (!inviterEmail) {
|
|
293
|
+
return segment
|
|
294
|
+
.replace("({inviterEmail})", "")
|
|
295
|
+
.replace("{inviterEmail}", "")
|
|
296
|
+
.replace(/\s{2,}/g, " ")
|
|
297
|
+
.replace(" .", ".")
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return (
|
|
301
|
+
<>
|
|
302
|
+
{beforeInviterEmail}
|
|
303
|
+
<Link
|
|
304
|
+
href={`mailto:${inviterEmail}`}
|
|
305
|
+
className="text-primary font-medium"
|
|
306
|
+
>
|
|
307
|
+
{inviterEmail}
|
|
308
|
+
</Link>
|
|
309
|
+
{afterInviterEmail}
|
|
310
|
+
</>
|
|
311
|
+
)
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
if (!inviterName) {
|
|
315
|
+
return renderInviterEmail(
|
|
316
|
+
text
|
|
317
|
+
.replace("{inviterName}", "")
|
|
318
|
+
.replace(/\s{2,}/g, " ")
|
|
319
|
+
.replace(" .", ".")
|
|
320
|
+
)
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return (
|
|
324
|
+
<>
|
|
325
|
+
{beforeInviterName}
|
|
326
|
+
<span className="font-medium">{inviterName}</span>
|
|
327
|
+
{renderInviterEmail(afterInviterName ?? "")}
|
|
328
|
+
</>
|
|
329
|
+
)
|
|
330
|
+
})()}
|
|
331
|
+
</Text>
|
|
332
|
+
|
|
333
|
+
<Section className="my-6">
|
|
334
|
+
<Button
|
|
335
|
+
href={url}
|
|
336
|
+
className={cn(
|
|
337
|
+
"inline-block whitespace-nowrap rounded-none text-sm font-medium py-2.5 px-6 bg-primary text-primary-foreground no-underline",
|
|
338
|
+
classNames?.button
|
|
339
|
+
)}
|
|
340
|
+
>
|
|
341
|
+
{localization.ACCEPT_INVITATION}
|
|
342
|
+
</Button>
|
|
343
|
+
</Section>
|
|
344
|
+
|
|
345
|
+
<Text
|
|
346
|
+
className={cn(
|
|
347
|
+
"m-0 mb-3 text-xs text-muted-foreground",
|
|
348
|
+
classNames?.description
|
|
349
|
+
)}
|
|
350
|
+
>
|
|
351
|
+
{localization.OR_COPY_AND_PASTE_URL}
|
|
352
|
+
</Text>
|
|
353
|
+
|
|
354
|
+
<Link
|
|
355
|
+
className={cn(
|
|
356
|
+
"break-all text-xs text-primary",
|
|
357
|
+
classNames?.link
|
|
358
|
+
)}
|
|
359
|
+
href={url}
|
|
360
|
+
>
|
|
361
|
+
{url}
|
|
362
|
+
</Link>
|
|
363
|
+
|
|
364
|
+
<Hr
|
|
365
|
+
className={cn(
|
|
366
|
+
"my-6 w-full border border-solid border-border",
|
|
367
|
+
classNames?.separator
|
|
368
|
+
)}
|
|
369
|
+
/>
|
|
370
|
+
|
|
371
|
+
{expirationHours || appName ? (
|
|
372
|
+
<Text
|
|
373
|
+
className={cn(
|
|
374
|
+
"m-0 mb-3 text-xs text-muted-foreground",
|
|
375
|
+
classNames?.description
|
|
376
|
+
)}
|
|
377
|
+
>
|
|
378
|
+
{expirationHours
|
|
379
|
+
? localization.THIS_INVITATION_EXPIRES_IN_HOURS.replace(
|
|
380
|
+
"{expirationHours}",
|
|
381
|
+
expirationHours.toString()
|
|
382
|
+
)
|
|
383
|
+
: null}
|
|
384
|
+
{appName && (
|
|
385
|
+
<>
|
|
386
|
+
{expirationHours ? " " : ""}
|
|
387
|
+
{localization.EMAIL_SENT_BY.replace("{appName}", appName)}
|
|
388
|
+
</>
|
|
389
|
+
)}
|
|
390
|
+
</Text>
|
|
391
|
+
) : null}
|
|
392
|
+
|
|
393
|
+
<Text
|
|
394
|
+
className={cn(
|
|
395
|
+
"m-0 text-xs text-muted-foreground",
|
|
396
|
+
classNames?.description
|
|
397
|
+
)}
|
|
398
|
+
>
|
|
399
|
+
{localization.IF_YOU_DIDNT_EXPECT_THIS_INVITATION}
|
|
400
|
+
</Text>
|
|
401
|
+
|
|
402
|
+
{poweredBy && (
|
|
403
|
+
<Text
|
|
404
|
+
className={cn(
|
|
405
|
+
"m-0 mt-4 text-center text-[11px] text-muted-foreground",
|
|
406
|
+
classNames?.poweredBy
|
|
407
|
+
)}
|
|
408
|
+
>
|
|
409
|
+
{(() => {
|
|
410
|
+
const [beforeBetterAuth, afterBetterAuth] =
|
|
411
|
+
localization.POWERED_BY_BETTER_AUTH.split("{betterAuth}")
|
|
412
|
+
|
|
413
|
+
return (
|
|
414
|
+
<>
|
|
415
|
+
{beforeBetterAuth}
|
|
416
|
+
<Link
|
|
417
|
+
href="https://better-auth.com"
|
|
418
|
+
className={cn(
|
|
419
|
+
"text-primary underline",
|
|
420
|
+
classNames?.link
|
|
421
|
+
)}
|
|
422
|
+
>
|
|
423
|
+
better-auth
|
|
424
|
+
</Link>
|
|
425
|
+
{afterBetterAuth}
|
|
426
|
+
</>
|
|
427
|
+
)
|
|
428
|
+
})()}
|
|
429
|
+
</Text>
|
|
430
|
+
)}
|
|
431
|
+
</Section>
|
|
432
|
+
</Container>
|
|
433
|
+
</Body>
|
|
434
|
+
</Tailwind>
|
|
435
|
+
</Html>
|
|
436
|
+
)
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
OrganizationInvitationEmail.localization =
|
|
440
|
+
organizationInvitationEmailLocalization
|
|
441
|
+
|
|
442
|
+
OrganizationInvitationEmail.PreviewProps = {
|
|
443
|
+
url: "https://better-auth-ui.com/settings/organizations",
|
|
444
|
+
email: "m@example.com",
|
|
445
|
+
inviterName: "Jane Doe",
|
|
446
|
+
inviterEmail: "jane@example.com",
|
|
447
|
+
organizationName: "Acme Inc.",
|
|
448
|
+
role: "member",
|
|
449
|
+
appName: "Better Auth",
|
|
450
|
+
expirationHours: 48,
|
|
451
|
+
darkMode: true
|
|
452
|
+
} as OrganizationInvitationEmailProps
|
|
453
|
+
|
|
454
|
+
export default OrganizationInvitationEmail
|