@better-auth-ui/react 1.6.8 → 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.
Files changed (233) hide show
  1. package/dist/components/auth/auth-context.d.ts +3 -0
  2. package/dist/components/auth/email/email-localization.d.ts +11 -3
  3. package/dist/components/auth/email/index.d.ts +1 -0
  4. package/dist/components/auth/email/organization-invitation.d.ts +121 -0
  5. package/dist/components/mutation-invalidator.d.ts +1 -0
  6. package/dist/email.js +1348 -11
  7. package/dist/hooks/auth/use-authenticate.d.ts +1 -1
  8. package/dist/hooks/auth/use-user.d.ts +12 -12
  9. package/dist/hooks/use-auth-query.d.ts +1 -1
  10. package/dist/index.d.ts +3 -0
  11. package/dist/index.js +2469 -79
  12. package/dist/lib/auth-client.d.ts +4 -1
  13. package/dist/lib/auth-plugin.d.ts +16 -0
  14. package/dist/lib/auth-server.d.ts +8 -1
  15. package/dist/lib/settings-tab.d.ts +19 -0
  16. package/dist/mutations/api-key/create-api-key-mutation.d.ts +6 -4
  17. package/dist/mutations/api-key/delete-api-key-mutation.d.ts +7 -3
  18. package/dist/mutations/auth/sign-in-email-mutation.d.ts +5 -5
  19. package/dist/mutations/auth/sign-out-mutation.d.ts +6 -4
  20. package/dist/mutations/auth/sign-up-email-mutation.d.ts +5 -5
  21. package/dist/mutations/multi-session/revoke-multi-session-mutation.d.ts +5 -5
  22. package/dist/mutations/multi-session/set-active-session-mutation.d.ts +5 -6
  23. package/dist/mutations/organization/accept-invitation-mutation.d.ts +43 -0
  24. package/dist/mutations/organization/cancel-invitation-mutation.d.ts +25 -0
  25. package/dist/mutations/organization/check-slug-mutation.d.ts +21 -0
  26. package/dist/mutations/organization/create-organization-mutation.d.ts +39 -0
  27. package/dist/mutations/organization/delete-organization-mutation.d.ts +21 -0
  28. package/dist/mutations/organization/index.d.ts +12 -0
  29. package/dist/mutations/organization/invite-member-mutation.d.ts +43 -0
  30. package/dist/mutations/organization/leave-organization-mutation.d.ts +65 -0
  31. package/dist/mutations/organization/reject-invitation-mutation.d.ts +31 -0
  32. package/dist/mutations/organization/remove-member-mutation.d.ts +35 -0
  33. package/dist/mutations/organization/set-active-organization-mutation.d.ts +71 -0
  34. package/dist/mutations/organization/update-member-role-mutation.d.ts +31 -0
  35. package/dist/mutations/organization/update-organization-mutation.d.ts +21 -0
  36. package/dist/mutations/passkey/add-passkey-mutation.d.ts +5 -5
  37. package/dist/mutations/passkey/delete-passkey-mutation.d.ts +5 -5
  38. package/dist/mutations/passkey/sign-in-passkey-mutation.d.ts +5 -5
  39. package/dist/mutations/settings/change-email-mutation.d.ts +6 -5
  40. package/dist/mutations/settings/revoke-session-mutation.d.ts +5 -5
  41. package/dist/mutations/settings/unlink-account-mutation.d.ts +5 -5
  42. package/dist/mutations/settings/update-user-mutation.d.ts +5 -5
  43. package/dist/mutations/username/sign-in-username-mutation.d.ts +5 -5
  44. package/dist/plugins/captcha-plugin.d.ts +2 -2
  45. package/dist/plugins.js +27 -2
  46. package/dist/queries/api-key/list-api-keys-query.d.ts +17 -8
  47. package/dist/queries/auth/session-query.d.ts +1 -1
  48. package/dist/queries/multi-session/list-device-sessions-query.d.ts +5 -5
  49. package/dist/queries/organization/active-organization-query.d.ts +39 -0
  50. package/dist/queries/organization/full-organization-query.d.ts +37 -0
  51. package/dist/queries/organization/has-permission-query.d.ts +21 -0
  52. package/dist/queries/organization/index.d.ts +7 -0
  53. package/dist/queries/organization/list-invitations-query.d.ts +29 -0
  54. package/dist/queries/organization/list-members-query.d.ts +61 -0
  55. package/dist/queries/organization/list-organizations-query.d.ts +22 -0
  56. package/dist/queries/organization/list-user-invitations-query.d.ts +29 -0
  57. package/dist/queries/passkey/list-passkeys-query.d.ts +5 -5
  58. package/dist/queries/settings/account-info-query.d.ts +1 -1
  59. package/dist/queries/settings/list-accounts-query.d.ts +1 -1
  60. package/dist/queries/settings/list-sessions-query.d.ts +1 -1
  61. package/dist/server/queries/api-key/list-api-keys-query.d.ts +83 -0
  62. package/dist/server/queries/multi-session/list-device-sessions-query.d.ts +4 -4
  63. package/dist/server/queries/organization/active-organization-query.d.ts +61 -0
  64. package/dist/server/queries/organization/full-organization-query.d.ts +42 -0
  65. package/dist/server/queries/organization/has-permission-query.d.ts +66 -0
  66. package/dist/server/queries/organization/list-invitations-query.d.ts +34 -0
  67. package/dist/server/queries/organization/list-members-query.d.ts +66 -0
  68. package/dist/server/queries/organization/list-organizations-query.d.ts +27 -0
  69. package/dist/server/queries/organization/list-user-invitations-query.d.ts +34 -0
  70. package/dist/server/queries/passkey/list-passkeys-query.d.ts +4 -4
  71. package/dist/server.d.ts +8 -0
  72. package/dist/server.js +131 -7
  73. package/dist/use-auth-plugin-ClcP84Uz.js +80 -0
  74. package/package.json +19 -16
  75. package/src/components/auth/auth-context.tsx +7 -0
  76. package/src/components/auth/auth-provider.tsx +19 -31
  77. package/src/components/auth/email/email-localization.tsx +5 -3
  78. package/src/components/auth/email/index.ts +1 -0
  79. package/src/components/auth/email/organization-invitation.tsx +454 -0
  80. package/src/components/mutation-invalidator.tsx +67 -0
  81. package/src/index.ts +3 -0
  82. package/src/lib/auth-client.ts +7 -0
  83. package/src/lib/auth-plugin.ts +17 -0
  84. package/src/lib/auth-server.ts +17 -1
  85. package/src/lib/settings-tab.ts +21 -0
  86. package/src/mutations/api-key/create-api-key-mutation.ts +34 -19
  87. package/src/mutations/api-key/delete-api-key-mutation.ts +36 -19
  88. package/src/mutations/auth/sign-in-email-mutation.ts +18 -22
  89. package/src/mutations/auth/sign-out-mutation.ts +19 -13
  90. package/src/mutations/auth/sign-up-email-mutation.ts +18 -22
  91. package/src/mutations/multi-session/revoke-multi-session-mutation.ts +31 -20
  92. package/src/mutations/multi-session/set-active-session-mutation.ts +25 -44
  93. package/src/mutations/organization/accept-invitation-mutation.ts +71 -0
  94. package/src/mutations/organization/cancel-invitation-mutation.ts +67 -0
  95. package/src/mutations/organization/check-slug-mutation.ts +55 -0
  96. package/src/mutations/organization/create-organization-mutation.ts +71 -0
  97. package/src/mutations/organization/delete-organization-mutation.ts +71 -0
  98. package/src/mutations/organization/index.ts +12 -0
  99. package/src/mutations/organization/invite-member-mutation.ts +81 -0
  100. package/src/mutations/organization/leave-organization-mutation.ts +74 -0
  101. package/src/mutations/organization/reject-invitation-mutation.ts +64 -0
  102. package/src/mutations/organization/remove-member-mutation.ts +67 -0
  103. package/src/mutations/organization/set-active-organization-mutation.ts +142 -0
  104. package/src/mutations/organization/update-member-role-mutation.ts +81 -0
  105. package/src/mutations/organization/update-organization-mutation.ts +84 -0
  106. package/src/mutations/passkey/add-passkey-mutation.ts +28 -17
  107. package/src/mutations/passkey/delete-passkey-mutation.ts +27 -17
  108. package/src/mutations/passkey/sign-in-passkey-mutation.ts +18 -21
  109. package/src/mutations/settings/change-email-mutation.ts +22 -18
  110. package/src/mutations/settings/delete-user-mutation.ts +2 -2
  111. package/src/mutations/settings/revoke-session-mutation.ts +24 -19
  112. package/src/mutations/settings/unlink-account-mutation.ts +24 -17
  113. package/src/mutations/settings/update-user-mutation.ts +18 -30
  114. package/src/mutations/username/is-username-available-mutation.ts +2 -2
  115. package/src/mutations/username/sign-in-username-mutation.ts +20 -23
  116. package/src/queries/api-key/list-api-keys-query.ts +20 -8
  117. package/src/queries/multi-session/list-device-sessions-query.ts +2 -2
  118. package/src/queries/organization/active-organization-query.ts +140 -0
  119. package/src/queries/organization/full-organization-query.ts +113 -0
  120. package/src/queries/organization/has-permission-query.ts +124 -0
  121. package/src/queries/organization/index.ts +7 -0
  122. package/src/queries/organization/list-invitations-query.ts +133 -0
  123. package/src/queries/organization/list-members-query.ts +133 -0
  124. package/src/queries/organization/list-organizations-query.ts +122 -0
  125. package/src/queries/organization/list-user-invitations-query.ts +122 -0
  126. package/src/queries/passkey/list-passkeys-query.ts +2 -2
  127. package/src/server/queries/api-key/list-api-keys-query.ts +94 -0
  128. package/src/server/queries/multi-session/list-device-sessions-query.ts +2 -2
  129. package/src/server/queries/organization/active-organization-query.ts +92 -0
  130. package/src/server/queries/organization/full-organization-query.ts +64 -0
  131. package/src/server/queries/organization/has-permission-query.ts +66 -0
  132. package/src/server/queries/organization/list-invitations-query.ts +81 -0
  133. package/src/server/queries/organization/list-members-query.ts +75 -0
  134. package/src/server/queries/organization/list-organizations-query.ts +67 -0
  135. package/src/server/queries/organization/list-user-invitations-query.ts +68 -0
  136. package/src/server/queries/passkey/list-passkeys-query.ts +2 -2
  137. package/src/server.ts +8 -0
  138. package/dist/components/auth/auth-provider.js +0 -44
  139. package/dist/components/auth/email/email-changed.js +0 -156
  140. package/dist/components/auth/email/email-localization.js +0 -19
  141. package/dist/components/auth/email/email-styles.js +0 -104
  142. package/dist/components/auth/email/email-verification.js +0 -140
  143. package/dist/components/auth/email/index.js +0 -9
  144. package/dist/components/auth/email/magic-link.js +0 -141
  145. package/dist/components/auth/email/new-device.js +0 -223
  146. package/dist/components/auth/email/otp-email.js +0 -129
  147. package/dist/components/auth/email/password-changed.js +0 -159
  148. package/dist/components/auth/email/reset-password.js +0 -140
  149. package/dist/components/auth/fetch-options-provider.js +0 -30
  150. package/dist/components/icons/apple.js +0 -17
  151. package/dist/components/icons/atlassian.js +0 -39
  152. package/dist/components/icons/cognito.js +0 -20
  153. package/dist/components/icons/discord.js +0 -17
  154. package/dist/components/icons/dropbox.js +0 -17
  155. package/dist/components/icons/facebook.js +0 -20
  156. package/dist/components/icons/figma.js +0 -35
  157. package/dist/components/icons/github.js +0 -17
  158. package/dist/components/icons/gitlab.js +0 -31
  159. package/dist/components/icons/google.js +0 -40
  160. package/dist/components/icons/huggingface.js +0 -39
  161. package/dist/components/icons/index.js +0 -35
  162. package/dist/components/icons/kakao.js +0 -17
  163. package/dist/components/icons/kick.js +0 -21
  164. package/dist/components/icons/line.js +0 -17
  165. package/dist/components/icons/linear.js +0 -17
  166. package/dist/components/icons/linkedin.js +0 -34
  167. package/dist/components/icons/microsoft.js +0 -31
  168. package/dist/components/icons/naver.js +0 -17
  169. package/dist/components/icons/notion.js +0 -17
  170. package/dist/components/icons/paybin.js +0 -33
  171. package/dist/components/icons/paypal.js +0 -31
  172. package/dist/components/icons/polar.js +0 -25
  173. package/dist/components/icons/railway.js +0 -17
  174. package/dist/components/icons/reddit.js +0 -22
  175. package/dist/components/icons/roblox.js +0 -18
  176. package/dist/components/icons/salesforce.js +0 -17
  177. package/dist/components/icons/slack.js +0 -31
  178. package/dist/components/icons/spotify.js +0 -17
  179. package/dist/components/icons/tiktok.js +0 -24
  180. package/dist/components/icons/twitch.js +0 -44
  181. package/dist/components/icons/vercel.js +0 -17
  182. package/dist/components/icons/vk.js +0 -17
  183. package/dist/components/icons/wechat.js +0 -17
  184. package/dist/components/icons/x.js +0 -17
  185. package/dist/components/icons/zoom.js +0 -70
  186. package/dist/components/settings/account/theme-preview.js +0 -289
  187. package/dist/hooks/auth/use-authenticate.js +0 -23
  188. package/dist/hooks/auth/use-user.js +0 -11
  189. package/dist/hooks/use-auth-mutation.js +0 -11
  190. package/dist/hooks/use-auth-plugin.js +0 -10
  191. package/dist/hooks/use-auth-query.js +0 -15
  192. package/dist/lib/provider-icons.js +0 -76
  193. package/dist/lib/utils.js +0 -8
  194. package/dist/mutations/api-key/create-api-key-mutation.js +0 -29
  195. package/dist/mutations/api-key/delete-api-key-mutation.js +0 -29
  196. package/dist/mutations/auth/request-password-reset-mutation.js +0 -24
  197. package/dist/mutations/auth/reset-password-mutation.js +0 -24
  198. package/dist/mutations/auth/send-verification-email-mutation.js +0 -24
  199. package/dist/mutations/auth/sign-in-email-mutation.js +0 -29
  200. package/dist/mutations/auth/sign-in-social-mutation.js +0 -24
  201. package/dist/mutations/auth/sign-out-mutation.js +0 -28
  202. package/dist/mutations/auth/sign-up-email-mutation.js +0 -29
  203. package/dist/mutations/auth-mutation-options.js +0 -19
  204. package/dist/mutations/magic-link/sign-in-magic-link-mutation.js +0 -24
  205. package/dist/mutations/multi-session/revoke-multi-session-mutation.js +0 -29
  206. package/dist/mutations/multi-session/set-active-session-mutation.js +0 -31
  207. package/dist/mutations/passkey/add-passkey-mutation.js +0 -29
  208. package/dist/mutations/passkey/delete-passkey-mutation.js +0 -29
  209. package/dist/mutations/passkey/sign-in-passkey-mutation.js +0 -29
  210. package/dist/mutations/settings/change-email-mutation.js +0 -29
  211. package/dist/mutations/settings/change-password-mutation.js +0 -24
  212. package/dist/mutations/settings/delete-user-mutation.js +0 -24
  213. package/dist/mutations/settings/link-social-mutation.js +0 -24
  214. package/dist/mutations/settings/revoke-session-mutation.js +0 -29
  215. package/dist/mutations/settings/unlink-account-mutation.js +0 -29
  216. package/dist/mutations/settings/update-user-mutation.js +0 -35
  217. package/dist/mutations/username/is-username-available-mutation.js +0 -24
  218. package/dist/mutations/username/sign-in-username-mutation.js +0 -29
  219. package/dist/plugins/captcha-plugin.js +0 -29
  220. package/dist/queries/api-key/list-api-keys-query.js +0 -31
  221. package/dist/queries/auth/session-query.js +0 -30
  222. package/dist/queries/auth-query-options.js +0 -17
  223. package/dist/queries/multi-session/list-device-sessions-query.js +0 -31
  224. package/dist/queries/passkey/list-passkeys-query.js +0 -31
  225. package/dist/queries/settings/account-info-query.js +0 -31
  226. package/dist/queries/settings/list-accounts-query.js +0 -31
  227. package/dist/queries/settings/list-sessions-query.js +0 -31
  228. package/dist/server/queries/auth/session-query.js +0 -13
  229. package/dist/server/queries/multi-session/list-device-sessions-query.js +0 -12
  230. package/dist/server/queries/passkey/list-passkeys-query.js +0 -12
  231. package/dist/server/queries/settings/account-info-query.js +0 -12
  232. package/dist/server/queries/settings/list-accounts-query.js +0 -12
  233. package/dist/server/queries/settings/list-sessions-query.js +0 -12
@@ -1,223 +0,0 @@
1
- import { cn as e } from "../../../lib/utils.js";
2
- import t from "./email-styles.js";
3
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
- import { Body as a, Button as o, Container as s, Head as c, Heading as l, Hr as u, Html as d, Img as f, Link as p, Preview as m, Section as h, Tailwind as g, Text as _, pixelBasedPreset as v } from "@react-email/components";
5
- //#region src/components/auth/email/new-device.tsx
6
- var y = {
7
- NEW_SIGN_IN_DETECTED: "New sign-in detected",
8
- LOGO: "Logo",
9
- NEW_SIGN_IN_TO_YOUR_ACCOUNT: "We detected a new sign-in to your {appName} account {userEmail} from a device we don't recognize.",
10
- DEVICE_DETAILS: "Device details",
11
- BROWSER: "Browser",
12
- OPERATING_SYSTEM: "Operating System",
13
- LOCATION: "Location",
14
- IP_ADDRESS: "IP Address",
15
- TIME: "Time",
16
- 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.",
17
- SECURE_MY_ACCOUNT: "Secure my account",
18
- EMAIL_SENT_BY: "Email sent by {appName}.",
19
- IF_YOU_DIDNT_SIGN_IN: "If you didn't sign in, please contact support immediately {supportEmail} to secure your account.",
20
- POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
21
- }, b = ({ userEmail: y, deviceInfo: x, secureAccountLink: S, appName: C, supportEmail: w, logoURL: T, colors: E, classNames: D, darkMode: O = !0, poweredBy: k, head: A, ...j }) => {
22
- let M = {
23
- ...b.localization,
24
- ...j.localization
25
- }, N = M.NEW_SIGN_IN_DETECTED;
26
- return /* @__PURE__ */ i(d, { children: [
27
- /* @__PURE__ */ i(c, { children: [
28
- /* @__PURE__ */ r("meta", {
29
- content: "light dark",
30
- name: "color-scheme"
31
- }),
32
- /* @__PURE__ */ r("meta", {
33
- content: "light dark",
34
- name: "supported-color-schemes"
35
- }),
36
- /* @__PURE__ */ r(t, {
37
- colors: E,
38
- darkMode: O
39
- }),
40
- A
41
- ] }),
42
- /* @__PURE__ */ r(m, { children: N }),
43
- /* @__PURE__ */ r(g, {
44
- config: { presets: [v] },
45
- children: /* @__PURE__ */ r(a, {
46
- className: e("bg-background font-sans", D?.body),
47
- children: /* @__PURE__ */ r(s, {
48
- className: e("mx-auto my-auto max-w-xl px-2 py-10", D?.container),
49
- children: /* @__PURE__ */ i(h, {
50
- className: e("bg-card text-card-foreground rounded-none border border-border p-8", D?.card),
51
- children: [
52
- T && (typeof T == "string" ? /* @__PURE__ */ r(f, {
53
- src: T,
54
- width: 48,
55
- height: 48,
56
- alt: C || M.LOGO,
57
- className: e("mx-auto mb-8", D?.logo)
58
- }) : /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(f, {
59
- src: T.light,
60
- width: 48,
61
- height: 48,
62
- alt: C || M.LOGO,
63
- className: e("mx-auto mb-8 logo-light", D?.logo)
64
- }), /* @__PURE__ */ r(f, {
65
- src: T.dark,
66
- width: 48,
67
- height: 48,
68
- alt: C || M.LOGO,
69
- className: e("hidden mx-auto mb-8 logo-dark", D?.logo)
70
- })] })),
71
- /* @__PURE__ */ r(l, {
72
- className: e("m-0 mb-5 text-2xl font-semibold", D?.title),
73
- children: M.NEW_SIGN_IN_DETECTED
74
- }),
75
- /* @__PURE__ */ r(_, {
76
- className: e("text-sm font-normal", D?.content),
77
- children: (() => {
78
- let e = M.NEW_SIGN_IN_TO_YOUR_ACCOUNT.replace("{appName}", C || "").replace(/\s{2,}/g, " ").replace(" .", "."), [t, a] = e.split("{userEmail}");
79
- return y ? /* @__PURE__ */ i(n, { children: [
80
- t,
81
- /* @__PURE__ */ r(p, {
82
- href: `mailto:${y}`,
83
- className: "text-primary font-medium",
84
- children: y
85
- }),
86
- a
87
- ] }) : e.replace("{userEmail}", "").replace(/\s{2,}/g, " ").replace(" .", ".");
88
- })()
89
- }),
90
- x && /* @__PURE__ */ i(h, {
91
- className: e("my-6 border border-border bg-muted p-4", D?.codeBlock),
92
- children: [
93
- /* @__PURE__ */ i(_, {
94
- className: e("m-0 mb-3 text-xs text-muted-foreground", D?.description),
95
- children: [M.DEVICE_DETAILS, ":"]
96
- }),
97
- x.browser && /* @__PURE__ */ i(_, {
98
- className: e("m-0 mb-2 text-sm", D?.content),
99
- children: [
100
- /* @__PURE__ */ i("span", {
101
- className: "font-semibold",
102
- children: [M.BROWSER, ":"]
103
- }),
104
- " ",
105
- x.browser
106
- ]
107
- }),
108
- x.os && /* @__PURE__ */ i(_, {
109
- className: e("m-0 mb-2 text-sm", D?.content),
110
- children: [
111
- /* @__PURE__ */ i("span", {
112
- className: "font-semibold",
113
- children: [M.OPERATING_SYSTEM, ":"]
114
- }),
115
- " ",
116
- x.os
117
- ]
118
- }),
119
- x.location && /* @__PURE__ */ i(_, {
120
- className: e("m-0 mb-2 text-sm", D?.content),
121
- children: [
122
- /* @__PURE__ */ i("span", {
123
- className: "font-semibold",
124
- children: [M.LOCATION, ":"]
125
- }),
126
- " ",
127
- x.location
128
- ]
129
- }),
130
- x.ipAddress && /* @__PURE__ */ i(_, {
131
- className: e("m-0 mb-2 text-sm", D?.content),
132
- children: [
133
- /* @__PURE__ */ i("span", {
134
- className: "font-semibold",
135
- children: [M.IP_ADDRESS, ":"]
136
- }),
137
- " ",
138
- x.ipAddress
139
- ]
140
- }),
141
- x.timestamp && /* @__PURE__ */ i(_, {
142
- className: e("m-0 text-sm", D?.content),
143
- children: [
144
- /* @__PURE__ */ i("span", {
145
- className: "font-semibold",
146
- children: [M.TIME, ":"]
147
- }),
148
- " ",
149
- x.timestamp
150
- ]
151
- })
152
- ]
153
- }),
154
- /* @__PURE__ */ r(_, {
155
- className: e("text-sm font-normal", D?.content),
156
- children: M.IF_THIS_WAS_YOU
157
- }),
158
- S && /* @__PURE__ */ r(h, {
159
- className: "mt-6",
160
- children: /* @__PURE__ */ r(o, {
161
- href: S,
162
- 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),
163
- children: M.SECURE_MY_ACCOUNT
164
- })
165
- }),
166
- /* @__PURE__ */ r(u, { className: e("my-6 w-full border border-solid border-border", D?.separator) }),
167
- C && /* @__PURE__ */ r(_, {
168
- className: e("mb-3 text-xs text-muted-foreground", D?.description),
169
- children: M.EMAIL_SENT_BY.replace("{appName}", C)
170
- }),
171
- /* @__PURE__ */ r(_, {
172
- className: e("mt-3 text-xs text-muted-foreground", D?.description),
173
- children: (() => {
174
- let [t, a] = M.IF_YOU_DIDNT_SIGN_IN.split("{supportEmail}");
175
- return w ? /* @__PURE__ */ i(n, { children: [
176
- t,
177
- /* @__PURE__ */ r(p, {
178
- href: `mailto:${w}`,
179
- className: e("text-primary underline", D?.link),
180
- children: w
181
- }),
182
- a
183
- ] }) : M.IF_YOU_DIDNT_SIGN_IN.replace("{supportEmail}", "").replace(/\s{2,}/g, " ").replace(" .", ".");
184
- })()
185
- }),
186
- k && /* @__PURE__ */ r(_, {
187
- className: e("mt-4 mb-0 text-center text-[11px] text-muted-foreground", D?.poweredBy),
188
- children: (() => {
189
- let [t, a] = M.POWERED_BY_BETTER_AUTH.split("{betterAuth}");
190
- return /* @__PURE__ */ i(n, { children: [
191
- t,
192
- /* @__PURE__ */ r(p, {
193
- href: "https://better-auth.com",
194
- className: e("text-primary underline", D?.link),
195
- children: "better-auth"
196
- }),
197
- a
198
- ] });
199
- })()
200
- })
201
- ]
202
- })
203
- })
204
- })
205
- })
206
- ] });
207
- };
208
- b.localization = y, b.PreviewProps = {
209
- userEmail: "m@example.com",
210
- deviceInfo: {
211
- browser: "Chrome on macOS",
212
- os: "macOS 26.2",
213
- location: "San Francisco, CA, United States",
214
- ipAddress: "127.0.0.1",
215
- timestamp: "February 10, 2025 at 4:20 PM UTC"
216
- },
217
- secureAccountLink: "https://better-auth-ui.com/auth/secure-account",
218
- appName: "Better Auth",
219
- supportEmail: "support@example.com",
220
- darkMode: !0
221
- };
222
- //#endregion
223
- export { b as default };
@@ -1,129 +0,0 @@
1
- import { cn as e } from "../../../lib/utils.js";
2
- import t from "./email-styles.js";
3
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
- import { Body as a, Container as o, Head as s, Heading as c, Hr as l, Html as u, Img as d, Link as f, Preview as p, Section as m, Tailwind as h, Text as g, pixelBasedPreset as _ } from "@react-email/components";
5
- //#region src/components/auth/email/otp-email.tsx
6
- var v = {
7
- YOUR_VERIFICATION_CODE_IS_CODE: "Your verification code is {verificationCode}",
8
- LOGO: "Logo",
9
- VERIFY_YOUR_EMAIL: "Verify your email",
10
- 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.",
11
- THIS_CODE_EXPIRES_IN_MINUTES: "This code expires in {expirationMinutes} minutes.",
12
- EMAIL_SENT_BY: "Email sent by {appName}.",
13
- 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.",
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
- ] });
121
- };
122
- y.localization = v, y.PreviewProps = {
123
- verificationCode: "069420",
124
- email: "m@example.com",
125
- appName: "Better Auth",
126
- darkMode: !0
127
- };
128
- //#endregion
129
- export { y as default };
@@ -1,159 +0,0 @@
1
- import { cn as e } from "../../../lib/utils.js";
2
- import t from "./email-styles.js";
3
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
- import { Body as a, Button as o, Container as s, Head as c, Heading as l, Hr as u, Html as d, Img as f, Link as p, Preview as m, Section as h, Tailwind as g, Text as _, pixelBasedPreset as v } from "@react-email/components";
5
- //#region src/components/auth/email/password-changed.tsx
6
- var y = {
7
- YOUR_PASSWORD_HAS_BEEN_CHANGED: "Your password has been changed",
8
- LOGO: "Logo",
9
- PASSWORD_CHANGED_SUCCESSFULLY: "Password changed successfully",
10
- PASSWORD_FOR_YOUR_ACCOUNT_CHANGED: "The password for your {appName} account {userEmail} has been changed successfully.",
11
- CHANGED_AT: "Changed at",
12
- IF_YOU_MADE_THIS_CHANGE: "If you made this change, you can safely ignore this email. Your account is secure.",
13
- I_DIDNT_MAKE_THIS_CHANGE: "I didn't make this change",
14
- EMAIL_SENT_BY: "Email sent by {appName}.",
15
- IF_YOU_DIDNT_AUTHORIZE_THIS_CHANGE: "If you didn't authorize this change, please contact support immediately {supportEmail} to secure your account.",
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
- ] });
149
- };
150
- b.localization = y, b.PreviewProps = {
151
- email: "m@example.com",
152
- timestamp: "February 10, 2025 at 4:20 PM UTC",
153
- secureAccountURL: "https://better-auth-ui.com/settings/security",
154
- appName: "Better Auth",
155
- supportEmail: "support@example.com",
156
- darkMode: !0
157
- };
158
- //#endregion
159
- export { b as default };
@@ -1,140 +0,0 @@
1
- import { cn as e } from "../../../lib/utils.js";
2
- import t from "./email-styles.js";
3
- import { Fragment as n, jsx as r, jsxs as i } from "react/jsx-runtime";
4
- import { Body as a, Button as o, Container as s, Head as c, Heading as l, Hr as u, Html as d, Img as f, Link as p, Preview as m, Section as h, Tailwind as g, Text as _, pixelBasedPreset as v } from "@react-email/components";
5
- //#region src/components/auth/email/reset-password.tsx
6
- var y = {
7
- RESET_YOUR_PASSWORD: "Reset your password",
8
- LOGO: "Logo",
9
- WE_RECEIVED_REQUEST_TO_RESET_PASSWORD: "We received a request to reset the password for your {appName} account {email}.",
10
- RESET_PASSWORD: "Reset password",
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_PASSWORD_RESET: "If you didn't request a password reset, you can safely ignore this email. Your password will remain unchanged.",
15
- POWERED_BY_BETTER_AUTH: "Powered by {betterAuth}"
16
- }, b = ({ url: y, email: x, appName: S, expirationMinutes: C = 60, logoURL: w, colors: T, classNames: E, darkMode: D = !0, poweredBy: O, head: k, ...A }) => {
17
- let j = {
18
- ...b.localization,
19
- ...A.localization
20
- }, M = j.RESET_YOUR_PASSWORD;
21
- return /* @__PURE__ */ i(d, { children: [
22
- /* @__PURE__ */ i(c, { children: [
23
- /* @__PURE__ */ r("meta", {
24
- content: "light dark",
25
- name: "color-scheme"
26
- }),
27
- /* @__PURE__ */ r("meta", {
28
- content: "light dark",
29
- name: "supported-color-schemes"
30
- }),
31
- /* @__PURE__ */ r(t, {
32
- colors: T,
33
- darkMode: D
34
- }),
35
- k
36
- ] }),
37
- /* @__PURE__ */ r(m, { children: M }),
38
- /* @__PURE__ */ r(g, {
39
- config: { presets: [v] },
40
- children: /* @__PURE__ */ r(a, {
41
- className: e("bg-background font-sans", E?.body),
42
- children: /* @__PURE__ */ r(s, {
43
- className: e("mx-auto my-auto max-w-xl px-2 py-10", E?.container),
44
- children: /* @__PURE__ */ i(h, {
45
- className: e("bg-card text-card-foreground rounded-none border border-border p-8", E?.card),
46
- children: [
47
- w && (typeof w == "string" ? /* @__PURE__ */ r(f, {
48
- src: w,
49
- width: 48,
50
- height: 48,
51
- alt: S || j.LOGO,
52
- className: e("mx-auto mb-8", E?.logo)
53
- }) : /* @__PURE__ */ i(n, { children: [/* @__PURE__ */ r(f, {
54
- src: w.light,
55
- width: 48,
56
- height: 48,
57
- alt: S || j.LOGO,
58
- className: e("mx-auto mb-8 logo-light", E?.logo)
59
- }), /* @__PURE__ */ r(f, {
60
- src: w.dark,
61
- width: 48,
62
- height: 48,
63
- alt: S || j.LOGO,
64
- className: e("hidden mx-auto mb-8 logo-dark", E?.logo)
65
- })] })),
66
- /* @__PURE__ */ r(l, {
67
- className: e("m-0 mb-5 text-2xl font-semibold", E?.title),
68
- children: j.RESET_YOUR_PASSWORD
69
- }),
70
- /* @__PURE__ */ r(_, {
71
- className: e("text-sm", E?.content),
72
- children: (() => {
73
- let e = j.WE_RECEIVED_REQUEST_TO_RESET_PASSWORD.replace("{appName}", S || "").replace(/\s{2,}/g, " ").replace(" .", "."), [t, a] = e.split("{email}");
74
- return x ? /* @__PURE__ */ i(n, { children: [
75
- t,
76
- /* @__PURE__ */ r(p, {
77
- href: `mailto:${x}`,
78
- className: "text-primary font-medium",
79
- children: x
80
- }),
81
- a
82
- ] }) : e.replace("{email}", "").replace(/\s{2,}/g, " ").replace(" .", ".");
83
- })()
84
- }),
85
- /* @__PURE__ */ r(h, {
86
- className: "my-6",
87
- children: /* @__PURE__ */ r(o, {
88
- href: y,
89
- className: e("inline-block whitespace-nowrap rounded-none text-sm font-medium py-2.5 px-6 bg-primary text-primary-foreground no-underline", E?.button),
90
- children: j.RESET_PASSWORD
91
- })
92
- }),
93
- /* @__PURE__ */ r(_, {
94
- className: e("m-0 mb-3 text-xs text-muted-foreground", E?.description),
95
- children: j.OR_COPY_AND_PASTE_URL
96
- }),
97
- /* @__PURE__ */ r(p, {
98
- className: e("break-all text-xs text-primary", E?.link),
99
- href: y,
100
- children: y
101
- }),
102
- /* @__PURE__ */ r(u, { className: e("my-6 w-full border border-solid border-border", E?.separator) }),
103
- C || S ? /* @__PURE__ */ i(_, {
104
- className: e("m-0 mb-3 text-xs text-muted-foreground", E?.description),
105
- children: [C ? j.THIS_LINK_EXPIRES_IN_MINUTES.replace("{expirationMinutes}", C.toString()) : null, S && /* @__PURE__ */ i(n, { children: [C ? " " : "", j.EMAIL_SENT_BY.replace("{appName}", S)] })]
106
- }) : null,
107
- /* @__PURE__ */ r(_, {
108
- className: e("m-0 text-xs text-muted-foreground", E?.description),
109
- children: j.IF_YOU_DIDNT_REQUEST_PASSWORD_RESET
110
- }),
111
- O && /* @__PURE__ */ r(_, {
112
- className: e("m-0 mt-4 text-center text-[11px] text-muted-foreground", E?.poweredBy),
113
- children: (() => {
114
- let [t, a] = j.POWERED_BY_BETTER_AUTH.split("{betterAuth}");
115
- return /* @__PURE__ */ i(n, { children: [
116
- t,
117
- /* @__PURE__ */ r(p, {
118
- href: "https://better-auth.com",
119
- className: e("text-primary underline", E?.link),
120
- children: "better-auth"
121
- }),
122
- a
123
- ] });
124
- })()
125
- })
126
- ]
127
- })
128
- })
129
- })
130
- })
131
- ] });
132
- };
133
- b.localization = y, b.PreviewProps = {
134
- url: "https://better-auth-ui.com/auth/reset-password?token=example-token",
135
- email: "m@example.com",
136
- appName: "Better Auth",
137
- darkMode: !0
138
- };
139
- //#endregion
140
- export { b as default };
@@ -1,30 +0,0 @@
1
- "use client";
2
- import { createContext as e, useCallback as t, useContext as n, useRef as r, useState as i } from "react";
3
- import { jsx as a } from "react/jsx-runtime";
4
- //#region src/components/auth/fetch-options-provider.tsx
5
- var o = e(void 0);
6
- function s({ children: e }) {
7
- let [n, s] = i(void 0), c = r(null), l = t((e) => {
8
- s(e);
9
- }, []), u = t((e) => {
10
- c.current = e;
11
- }, []), d = t(() => {
12
- s(void 0), c.current?.();
13
- }, []);
14
- return /* @__PURE__ */ a(o.Provider, {
15
- value: {
16
- fetchOptions: n,
17
- setFetchOptions: l,
18
- resetFetchOptions: d,
19
- registerReset: u
20
- },
21
- children: e
22
- });
23
- }
24
- function c() {
25
- let e = n(o);
26
- if (!e) throw Error("[Better Auth UI] useFetchOptions must be used within FetchOptionsProvider");
27
- return e;
28
- }
29
- //#endregion
30
- export { s as FetchOptionsProvider, c as useFetchOptions };