create-croissant 0.1.7 → 0.1.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.
Files changed (482) hide show
  1. package/package.json +1 -1
  2. package/template/apps/web/package.json +4 -0
  3. package/template/apps/web/src/components/login-form.tsx +95 -48
  4. package/template/apps/web/src/components/signup-form.tsx +149 -79
  5. package/template/apps/web/src/routes/__root.tsx +18 -11
  6. package/template/apps/web/src/routes/client-orpc-auth.tsx +8 -20
  7. package/template/apps/web/src/routes/client-orpc.tsx +269 -24
  8. package/template/apps/web/src/routes/isr.tsx +4 -0
  9. package/template/apps/web/src/routes/ssr-orpc.tsx +245 -18
  10. package/template/apps/web/vite.config.ts +5 -1
  11. package/template/package.json +3 -1
  12. package/template/packages/orpc/src/lib/router.ts +63 -0
  13. package/template/apps/web/node_modules/@better-auth/core/LICENSE.md +0 -20
  14. package/template/apps/web/node_modules/@better-auth/core/README.md +0 -17
  15. package/template/apps/web/node_modules/@better-auth/core/dist/api/index.d.mts +0 -278
  16. package/template/apps/web/node_modules/@better-auth/core/dist/api/index.mjs +0 -56
  17. package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/index.d.mts +0 -6
  18. package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/index.mjs +0 -20
  19. package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/pure.index.d.mts +0 -6
  20. package/template/apps/web/node_modules/@better-auth/core/dist/async_hooks/pure.index.mjs +0 -33
  21. package/template/apps/web/node_modules/@better-auth/core/dist/context/endpoint-context.d.mts +0 -18
  22. package/template/apps/web/node_modules/@better-auth/core/dist/context/endpoint-context.mjs +0 -29
  23. package/template/apps/web/node_modules/@better-auth/core/dist/context/global.d.mts +0 -6
  24. package/template/apps/web/node_modules/@better-auth/core/dist/context/global.mjs +0 -36
  25. package/template/apps/web/node_modules/@better-auth/core/dist/context/index.d.mts +0 -5
  26. package/template/apps/web/node_modules/@better-auth/core/dist/context/index.mjs +0 -5
  27. package/template/apps/web/node_modules/@better-auth/core/dist/context/request-state.d.mts +0 -27
  28. package/template/apps/web/node_modules/@better-auth/core/dist/context/request-state.mjs +0 -47
  29. package/template/apps/web/node_modules/@better-auth/core/dist/context/transaction.d.mts +0 -24
  30. package/template/apps/web/node_modules/@better-auth/core/dist/context/transaction.mjs +0 -93
  31. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/factory.d.mts +0 -17
  32. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/factory.mjs +0 -754
  33. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-field-name.d.mts +0 -18
  34. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-field-name.mjs +0 -36
  35. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-model-name.d.mts +0 -12
  36. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-default-model-name.mjs +0 -30
  37. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-attributes.d.mts +0 -26
  38. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-attributes.mjs +0 -37
  39. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-name.d.mts +0 -18
  40. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-field-name.mjs +0 -31
  41. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-id-field.d.mts +0 -36
  42. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-id-field.mjs +0 -64
  43. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-model-name.d.mts +0 -12
  44. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/get-model-name.mjs +0 -21
  45. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/index.d.mts +0 -525
  46. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/index.mjs +0 -24
  47. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/types.d.mts +0 -105
  48. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/utils.d.mts +0 -7
  49. package/template/apps/web/node_modules/@better-auth/core/dist/db/adapter/utils.mjs +0 -37
  50. package/template/apps/web/node_modules/@better-auth/core/dist/db/get-tables.d.mts +0 -6
  51. package/template/apps/web/node_modules/@better-auth/core/dist/db/get-tables.mjs +0 -265
  52. package/template/apps/web/node_modules/@better-auth/core/dist/db/index.d.mts +0 -10
  53. package/template/apps/web/node_modules/@better-auth/core/dist/db/index.mjs +0 -8
  54. package/template/apps/web/node_modules/@better-auth/core/dist/db/plugin.d.mts +0 -12
  55. package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/account.d.mts +0 -28
  56. package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/account.mjs +0 -17
  57. package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/rate-limit.d.mts +0 -18
  58. package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/rate-limit.mjs +0 -9
  59. package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/session.d.mts +0 -23
  60. package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/session.mjs +0 -12
  61. package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/shared.d.mts +0 -10
  62. package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/shared.mjs +0 -9
  63. package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/user.d.mts +0 -22
  64. package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/user.mjs +0 -11
  65. package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/verification.d.mts +0 -21
  66. package/template/apps/web/node_modules/@better-auth/core/dist/db/schema/verification.mjs +0 -10
  67. package/template/apps/web/node_modules/@better-auth/core/dist/db/type.d.mts +0 -167
  68. package/template/apps/web/node_modules/@better-auth/core/dist/env/color-depth.d.mts +0 -4
  69. package/template/apps/web/node_modules/@better-auth/core/dist/env/color-depth.mjs +0 -86
  70. package/template/apps/web/node_modules/@better-auth/core/dist/env/env-impl.d.mts +0 -32
  71. package/template/apps/web/node_modules/@better-auth/core/dist/env/env-impl.mjs +0 -81
  72. package/template/apps/web/node_modules/@better-auth/core/dist/env/index.d.mts +0 -4
  73. package/template/apps/web/node_modules/@better-auth/core/dist/env/index.mjs +0 -4
  74. package/template/apps/web/node_modules/@better-auth/core/dist/env/logger.d.mts +0 -48
  75. package/template/apps/web/node_modules/@better-auth/core/dist/env/logger.mjs +0 -79
  76. package/template/apps/web/node_modules/@better-auth/core/dist/error/codes.d.mts +0 -68
  77. package/template/apps/web/node_modules/@better-auth/core/dist/error/codes.mjs +0 -54
  78. package/template/apps/web/node_modules/@better-auth/core/dist/error/index.d.mts +0 -19
  79. package/template/apps/web/node_modules/@better-auth/core/dist/error/index.mjs +0 -27
  80. package/template/apps/web/node_modules/@better-auth/core/dist/index.d.mts +0 -9
  81. package/template/apps/web/node_modules/@better-auth/core/dist/index.mjs +0 -1
  82. package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/api.mjs +0 -12
  83. package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/attributes.d.mts +0 -11
  84. package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/attributes.mjs +0 -10
  85. package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/index.d.mts +0 -3
  86. package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/index.mjs +0 -3
  87. package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/noop.mjs +0 -42
  88. package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/pure.index.d.mts +0 -7
  89. package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/pure.index.mjs +0 -7
  90. package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/tracer.d.mts +0 -13
  91. package/template/apps/web/node_modules/@better-auth/core/dist/instrumentation/tracer.mjs +0 -53
  92. package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/client-credentials-token.d.mts +0 -56
  93. package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/client-credentials-token.mjs +0 -64
  94. package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/create-authorization-url.d.mts +0 -44
  95. package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/create-authorization-url.mjs +0 -41
  96. package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/index.d.mts +0 -8
  97. package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/index.mjs +0 -7
  98. package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/oauth-provider.d.mts +0 -192
  99. package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/refresh-access-token.d.mts +0 -54
  100. package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/refresh-access-token.mjs +0 -73
  101. package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/utils.d.mts +0 -16
  102. package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/utils.mjs +0 -37
  103. package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/validate-authorization-code.d.mts +0 -85
  104. package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/validate-authorization-code.mjs +0 -79
  105. package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/verify.d.mts +0 -42
  106. package/template/apps/web/node_modules/@better-auth/core/dist/oauth2/verify.mjs +0 -92
  107. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/apple.d.mts +0 -126
  108. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/apple.mjs +0 -107
  109. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/atlassian.d.mts +0 -70
  110. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/atlassian.mjs +0 -80
  111. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/cognito.d.mts +0 -85
  112. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/cognito.mjs +0 -162
  113. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/discord.d.mts +0 -124
  114. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/discord.mjs +0 -62
  115. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/dropbox.d.mts +0 -69
  116. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/dropbox.mjs +0 -72
  117. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/facebook.d.mts +0 -79
  118. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/facebook.mjs +0 -124
  119. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/figma.d.mts +0 -61
  120. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/figma.mjs +0 -83
  121. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/github.d.mts +0 -102
  122. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/github.mjs +0 -92
  123. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/gitlab.d.mts +0 -123
  124. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/gitlab.mjs +0 -79
  125. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/google.d.mts +0 -97
  126. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/google.mjs +0 -109
  127. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/huggingface.d.mts +0 -83
  128. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/huggingface.mjs +0 -73
  129. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/index.d.mts +0 -1834
  130. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/index.mjs +0 -78
  131. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kakao.d.mts +0 -161
  132. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kakao.mjs +0 -70
  133. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kick.d.mts +0 -73
  134. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/kick.mjs +0 -68
  135. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/line.d.mts +0 -105
  136. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/line.mjs +0 -110
  137. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linear.d.mts +0 -68
  138. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linear.mjs +0 -85
  139. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linkedin.d.mts +0 -67
  140. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/linkedin.mjs +0 -73
  141. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/microsoft-entra-id.d.mts +0 -174
  142. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/microsoft-entra-id.mjs +0 -140
  143. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/naver.d.mts +0 -92
  144. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/naver.mjs +0 -65
  145. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/notion.d.mts +0 -64
  146. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/notion.mjs +0 -72
  147. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paybin.d.mts +0 -71
  148. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paybin.mjs +0 -81
  149. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paypal.d.mts +0 -129
  150. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/paypal.mjs +0 -140
  151. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/polar.d.mts +0 -74
  152. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/polar.mjs +0 -71
  153. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/railway.d.mts +0 -65
  154. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/railway.mjs +0 -74
  155. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/reddit.d.mts +0 -62
  156. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/reddit.mjs +0 -80
  157. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/roblox.d.mts +0 -70
  158. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/roblox.mjs +0 -57
  159. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/salesforce.d.mts +0 -79
  160. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/salesforce.mjs +0 -87
  161. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/slack.d.mts +0 -83
  162. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/slack.mjs +0 -66
  163. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/spotify.d.mts +0 -63
  164. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/spotify.mjs +0 -69
  165. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/tiktok.d.mts +0 -168
  166. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/tiktok.mjs +0 -60
  167. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitch.d.mts +0 -79
  168. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitch.mjs +0 -75
  169. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitter.d.mts +0 -126
  170. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/twitter.mjs +0 -85
  171. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vercel.d.mts +0 -62
  172. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vercel.mjs +0 -58
  173. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vk.d.mts +0 -70
  174. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/vk.mjs +0 -81
  175. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/wechat.d.mts +0 -113
  176. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/wechat.mjs +0 -81
  177. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/zoom.d.mts +0 -163
  178. package/template/apps/web/node_modules/@better-auth/core/dist/social-providers/zoom.mjs +0 -69
  179. package/template/apps/web/node_modules/@better-auth/core/dist/types/context.d.mts +0 -277
  180. package/template/apps/web/node_modules/@better-auth/core/dist/types/cookie.d.mts +0 -15
  181. package/template/apps/web/node_modules/@better-auth/core/dist/types/helper.d.mts +0 -10
  182. package/template/apps/web/node_modules/@better-auth/core/dist/types/index.d.mts +0 -9
  183. package/template/apps/web/node_modules/@better-auth/core/dist/types/init-options.d.mts +0 -1358
  184. package/template/apps/web/node_modules/@better-auth/core/dist/types/plugin-client.d.mts +0 -113
  185. package/template/apps/web/node_modules/@better-auth/core/dist/types/plugin.d.mts +0 -124
  186. package/template/apps/web/node_modules/@better-auth/core/dist/types/secret.d.mts +0 -11
  187. package/template/apps/web/node_modules/@better-auth/core/dist/utils/async.d.mts +0 -22
  188. package/template/apps/web/node_modules/@better-auth/core/dist/utils/async.mjs +0 -32
  189. package/template/apps/web/node_modules/@better-auth/core/dist/utils/db.d.mts +0 -9
  190. package/template/apps/web/node_modules/@better-auth/core/dist/utils/db.mjs +0 -15
  191. package/template/apps/web/node_modules/@better-auth/core/dist/utils/deprecate.d.mts +0 -9
  192. package/template/apps/web/node_modules/@better-auth/core/dist/utils/deprecate.mjs +0 -16
  193. package/template/apps/web/node_modules/@better-auth/core/dist/utils/error-codes.d.mts +0 -13
  194. package/template/apps/web/node_modules/@better-auth/core/dist/utils/error-codes.mjs +0 -10
  195. package/template/apps/web/node_modules/@better-auth/core/dist/utils/fetch-metadata.d.mts +0 -4
  196. package/template/apps/web/node_modules/@better-auth/core/dist/utils/fetch-metadata.mjs +0 -6
  197. package/template/apps/web/node_modules/@better-auth/core/dist/utils/host.d.mts +0 -147
  198. package/template/apps/web/node_modules/@better-auth/core/dist/utils/host.mjs +0 -291
  199. package/template/apps/web/node_modules/@better-auth/core/dist/utils/id.d.mts +0 -4
  200. package/template/apps/web/node_modules/@better-auth/core/dist/utils/id.mjs +0 -7
  201. package/template/apps/web/node_modules/@better-auth/core/dist/utils/ip.d.mts +0 -54
  202. package/template/apps/web/node_modules/@better-auth/core/dist/utils/ip.mjs +0 -116
  203. package/template/apps/web/node_modules/@better-auth/core/dist/utils/is-api-error.d.mts +0 -6
  204. package/template/apps/web/node_modules/@better-auth/core/dist/utils/is-api-error.mjs +0 -8
  205. package/template/apps/web/node_modules/@better-auth/core/dist/utils/json.d.mts +0 -4
  206. package/template/apps/web/node_modules/@better-auth/core/dist/utils/json.mjs +0 -41
  207. package/template/apps/web/node_modules/@better-auth/core/dist/utils/string.d.mts +0 -4
  208. package/template/apps/web/node_modules/@better-auth/core/dist/utils/string.mjs +0 -6
  209. package/template/apps/web/node_modules/@better-auth/core/dist/utils/url.d.mts +0 -20
  210. package/template/apps/web/node_modules/@better-auth/core/dist/utils/url.mjs +0 -31
  211. package/template/apps/web/node_modules/@better-auth/core/package.json +0 -193
  212. package/template/apps/web/node_modules/@better-auth/core/src/api/index.ts +0 -140
  213. package/template/apps/web/node_modules/@better-auth/core/src/async_hooks/index.ts +0 -40
  214. package/template/apps/web/node_modules/@better-auth/core/src/async_hooks/pure.index.ts +0 -46
  215. package/template/apps/web/node_modules/@better-auth/core/src/context/endpoint-context.ts +0 -50
  216. package/template/apps/web/node_modules/@better-auth/core/src/context/global.ts +0 -57
  217. package/template/apps/web/node_modules/@better-auth/core/src/context/index.ts +0 -23
  218. package/template/apps/web/node_modules/@better-auth/core/src/context/request-state.ts +0 -91
  219. package/template/apps/web/node_modules/@better-auth/core/src/context/transaction.ts +0 -136
  220. package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/factory.ts +0 -1440
  221. package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-default-field-name.ts +0 -59
  222. package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-default-model-name.ts +0 -51
  223. package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-field-attributes.ts +0 -62
  224. package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-field-name.ts +0 -43
  225. package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-id-field.ts +0 -150
  226. package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/get-model-name.ts +0 -36
  227. package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/index.ts +0 -567
  228. package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/types.ts +0 -132
  229. package/template/apps/web/node_modules/@better-auth/core/src/db/adapter/utils.ts +0 -61
  230. package/template/apps/web/node_modules/@better-auth/core/src/db/get-tables.ts +0 -296
  231. package/template/apps/web/node_modules/@better-auth/core/src/db/index.ts +0 -43
  232. package/template/apps/web/node_modules/@better-auth/core/src/db/plugin.ts +0 -11
  233. package/template/apps/web/node_modules/@better-auth/core/src/db/schema/account.ts +0 -47
  234. package/template/apps/web/node_modules/@better-auth/core/src/db/schema/rate-limit.ts +0 -36
  235. package/template/apps/web/node_modules/@better-auth/core/src/db/schema/session.ts +0 -29
  236. package/template/apps/web/node_modules/@better-auth/core/src/db/schema/shared.ts +0 -7
  237. package/template/apps/web/node_modules/@better-auth/core/src/db/schema/user.ts +0 -28
  238. package/template/apps/web/node_modules/@better-auth/core/src/db/schema/verification.ts +0 -28
  239. package/template/apps/web/node_modules/@better-auth/core/src/db/type.ts +0 -333
  240. package/template/apps/web/node_modules/@better-auth/core/src/env/color-depth.ts +0 -172
  241. package/template/apps/web/node_modules/@better-auth/core/src/env/env-impl.ts +0 -124
  242. package/template/apps/web/node_modules/@better-auth/core/src/env/index.ts +0 -23
  243. package/template/apps/web/node_modules/@better-auth/core/src/env/logger.ts +0 -145
  244. package/template/apps/web/node_modules/@better-auth/core/src/error/codes.ts +0 -71
  245. package/template/apps/web/node_modules/@better-auth/core/src/error/index.ts +0 -35
  246. package/template/apps/web/node_modules/@better-auth/core/src/index.ts +0 -1
  247. package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/api.ts +0 -17
  248. package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/attributes.ts +0 -22
  249. package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/index.ts +0 -2
  250. package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/noop.ts +0 -74
  251. package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/pure.index.ts +0 -31
  252. package/template/apps/web/node_modules/@better-auth/core/src/instrumentation/tracer.ts +0 -95
  253. package/template/apps/web/node_modules/@better-auth/core/src/oauth2/client-credentials-token.ts +0 -126
  254. package/template/apps/web/node_modules/@better-auth/core/src/oauth2/create-authorization-url.ts +0 -89
  255. package/template/apps/web/node_modules/@better-auth/core/src/oauth2/index.ts +0 -33
  256. package/template/apps/web/node_modules/@better-auth/core/src/oauth2/oauth-provider.ts +0 -222
  257. package/template/apps/web/node_modules/@better-auth/core/src/oauth2/refresh-access-token.ts +0 -157
  258. package/template/apps/web/node_modules/@better-auth/core/src/oauth2/utils.ts +0 -51
  259. package/template/apps/web/node_modules/@better-auth/core/src/oauth2/validate-authorization-code.ts +0 -180
  260. package/template/apps/web/node_modules/@better-auth/core/src/oauth2/verify.ts +0 -221
  261. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/apple.ts +0 -231
  262. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/atlassian.ts +0 -133
  263. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/cognito.ts +0 -281
  264. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/discord.ts +0 -170
  265. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/dropbox.ts +0 -112
  266. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/facebook.ts +0 -215
  267. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/figma.ts +0 -118
  268. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/github.ts +0 -184
  269. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/gitlab.ts +0 -155
  270. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/google.ts +0 -204
  271. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/huggingface.ts +0 -119
  272. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/index.ts +0 -132
  273. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/kakao.ts +0 -179
  274. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/kick.ts +0 -109
  275. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/line.ts +0 -169
  276. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/linear.ts +0 -121
  277. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/linkedin.ts +0 -110
  278. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/microsoft-entra-id.ts +0 -352
  279. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/naver.ts +0 -113
  280. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/notion.ts +0 -108
  281. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/paybin.ts +0 -118
  282. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/paypal.ts +0 -263
  283. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/polar.ts +0 -111
  284. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/railway.ts +0 -100
  285. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/reddit.ts +0 -122
  286. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/roblox.ts +0 -112
  287. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/salesforce.ts +0 -159
  288. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/slack.ts +0 -112
  289. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/spotify.ts +0 -94
  290. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/tiktok.ts +0 -211
  291. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/twitch.ts +0 -112
  292. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/twitter.ts +0 -199
  293. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/vercel.ts +0 -87
  294. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/vk.ts +0 -125
  295. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/wechat.ts +0 -213
  296. package/template/apps/web/node_modules/@better-auth/core/src/social-providers/zoom.ts +0 -230
  297. package/template/apps/web/node_modules/@better-auth/core/src/types/context.ts +0 -415
  298. package/template/apps/web/node_modules/@better-auth/core/src/types/cookie.ts +0 -10
  299. package/template/apps/web/node_modules/@better-auth/core/src/types/helper.ts +0 -27
  300. package/template/apps/web/node_modules/@better-auth/core/src/types/index.ts +0 -40
  301. package/template/apps/web/node_modules/@better-auth/core/src/types/init-options.ts +0 -1610
  302. package/template/apps/web/node_modules/@better-auth/core/src/types/plugin-client.ts +0 -129
  303. package/template/apps/web/node_modules/@better-auth/core/src/types/plugin.ts +0 -163
  304. package/template/apps/web/node_modules/@better-auth/core/src/types/secret.ts +0 -8
  305. package/template/apps/web/node_modules/@better-auth/core/src/utils/async.ts +0 -53
  306. package/template/apps/web/node_modules/@better-auth/core/src/utils/db.ts +0 -20
  307. package/template/apps/web/node_modules/@better-auth/core/src/utils/deprecate.ts +0 -21
  308. package/template/apps/web/node_modules/@better-auth/core/src/utils/error-codes.ts +0 -68
  309. package/template/apps/web/node_modules/@better-auth/core/src/utils/fetch-metadata.ts +0 -3
  310. package/template/apps/web/node_modules/@better-auth/core/src/utils/host.ts +0 -401
  311. package/template/apps/web/node_modules/@better-auth/core/src/utils/id.ts +0 -5
  312. package/template/apps/web/node_modules/@better-auth/core/src/utils/ip.ts +0 -211
  313. package/template/apps/web/node_modules/@better-auth/core/src/utils/is-api-error.ts +0 -10
  314. package/template/apps/web/node_modules/@better-auth/core/src/utils/json.ts +0 -56
  315. package/template/apps/web/node_modules/@better-auth/core/src/utils/string.ts +0 -3
  316. package/template/apps/web/node_modules/@better-auth/core/src/utils/url.ts +0 -43
  317. package/template/apps/web/node_modules/@better-auth/utils/README.md +0 -384
  318. package/template/apps/web/node_modules/@better-auth/utils/dist/base32.cjs +0 -104
  319. package/template/apps/web/node_modules/@better-auth/utils/dist/base32.d.cts +0 -44
  320. package/template/apps/web/node_modules/@better-auth/utils/dist/base32.d.mts +0 -44
  321. package/template/apps/web/node_modules/@better-auth/utils/dist/base32.d.ts +0 -44
  322. package/template/apps/web/node_modules/@better-auth/utils/dist/base32.mjs +0 -101
  323. package/template/apps/web/node_modules/@better-auth/utils/dist/base64.cjs +0 -80
  324. package/template/apps/web/node_modules/@better-auth/utils/dist/base64.d.cts +0 -16
  325. package/template/apps/web/node_modules/@better-auth/utils/dist/base64.d.mts +0 -16
  326. package/template/apps/web/node_modules/@better-auth/utils/dist/base64.d.ts +0 -16
  327. package/template/apps/web/node_modules/@better-auth/utils/dist/base64.mjs +0 -77
  328. package/template/apps/web/node_modules/@better-auth/utils/dist/binary.cjs +0 -16
  329. package/template/apps/web/node_modules/@better-auth/utils/dist/binary.d.cts +0 -8
  330. package/template/apps/web/node_modules/@better-auth/utils/dist/binary.d.mts +0 -8
  331. package/template/apps/web/node_modules/@better-auth/utils/dist/binary.d.ts +0 -8
  332. package/template/apps/web/node_modules/@better-auth/utils/dist/binary.mjs +0 -14
  333. package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.cjs +0 -90
  334. package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.d.cts +0 -19
  335. package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.d.mts +0 -19
  336. package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.d.ts +0 -19
  337. package/template/apps/web/node_modules/@better-auth/utils/dist/ecdsa.mjs +0 -88
  338. package/template/apps/web/node_modules/@better-auth/utils/dist/hash.cjs +0 -31
  339. package/template/apps/web/node_modules/@better-auth/utils/dist/hash.d.cts +0 -7
  340. package/template/apps/web/node_modules/@better-auth/utils/dist/hash.d.mts +0 -7
  341. package/template/apps/web/node_modules/@better-auth/utils/dist/hash.d.ts +0 -7
  342. package/template/apps/web/node_modules/@better-auth/utils/dist/hash.mjs +0 -29
  343. package/template/apps/web/node_modules/@better-auth/utils/dist/hex.cjs +0 -40
  344. package/template/apps/web/node_modules/@better-auth/utils/dist/hex.d.cts +0 -8
  345. package/template/apps/web/node_modules/@better-auth/utils/dist/hex.d.mts +0 -8
  346. package/template/apps/web/node_modules/@better-auth/utils/dist/hex.d.ts +0 -8
  347. package/template/apps/web/node_modules/@better-auth/utils/dist/hex.mjs +0 -38
  348. package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.cjs +0 -58
  349. package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.d.cts +0 -9
  350. package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.d.mts +0 -9
  351. package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.d.ts +0 -9
  352. package/template/apps/web/node_modules/@better-auth/utils/dist/hmac.mjs +0 -56
  353. package/template/apps/web/node_modules/@better-auth/utils/dist/index.cjs +0 -10
  354. package/template/apps/web/node_modules/@better-auth/utils/dist/index.d.cts +0 -3
  355. package/template/apps/web/node_modules/@better-auth/utils/dist/index.d.mts +0 -3
  356. package/template/apps/web/node_modules/@better-auth/utils/dist/index.d.ts +0 -3
  357. package/template/apps/web/node_modules/@better-auth/utils/dist/index.mjs +0 -8
  358. package/template/apps/web/node_modules/@better-auth/utils/dist/otp.cjs +0 -90
  359. package/template/apps/web/node_modules/@better-auth/utils/dist/otp.d.cts +0 -13
  360. package/template/apps/web/node_modules/@better-auth/utils/dist/otp.d.mts +0 -13
  361. package/template/apps/web/node_modules/@better-auth/utils/dist/otp.d.ts +0 -13
  362. package/template/apps/web/node_modules/@better-auth/utils/dist/otp.mjs +0 -88
  363. package/template/apps/web/node_modules/@better-auth/utils/dist/password.cjs +0 -36
  364. package/template/apps/web/node_modules/@better-auth/utils/dist/password.d.cts +0 -4
  365. package/template/apps/web/node_modules/@better-auth/utils/dist/password.d.mts +0 -4
  366. package/template/apps/web/node_modules/@better-auth/utils/dist/password.d.ts +0 -4
  367. package/template/apps/web/node_modules/@better-auth/utils/dist/password.mjs +0 -33
  368. package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.cjs +0 -47
  369. package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.d.cts +0 -4
  370. package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.d.mts +0 -4
  371. package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.d.ts +0 -4
  372. package/template/apps/web/node_modules/@better-auth/utils/dist/password.node.mjs +0 -44
  373. package/template/apps/web/node_modules/@better-auth/utils/dist/random.cjs +0 -55
  374. package/template/apps/web/node_modules/@better-auth/utils/dist/random.d.cts +0 -4
  375. package/template/apps/web/node_modules/@better-auth/utils/dist/random.d.mts +0 -4
  376. package/template/apps/web/node_modules/@better-auth/utils/dist/random.d.ts +0 -4
  377. package/template/apps/web/node_modules/@better-auth/utils/dist/random.mjs +0 -53
  378. package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.cjs +0 -76
  379. package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.d.cts +0 -16
  380. package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.d.mts +0 -16
  381. package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.d.ts +0 -16
  382. package/template/apps/web/node_modules/@better-auth/utils/dist/rsa.mjs +0 -74
  383. package/template/apps/web/node_modules/@better-auth/utils/dist/shared/utils.ecd028f7.d.cts +0 -22
  384. package/template/apps/web/node_modules/@better-auth/utils/dist/shared/utils.ecd028f7.d.mts +0 -22
  385. package/template/apps/web/node_modules/@better-auth/utils/dist/shared/utils.ecd028f7.d.ts +0 -22
  386. package/template/apps/web/node_modules/@better-auth/utils/package.json +0 -95
  387. package/template/apps/web/node_modules/better-call/LICENSE +0 -21
  388. package/template/apps/web/node_modules/better-call/dist/_virtual/_rolldown/runtime.cjs +0 -29
  389. package/template/apps/web/node_modules/better-call/dist/adapters/node/request.cjs +0 -181
  390. package/template/apps/web/node_modules/better-call/dist/adapters/node/request.cjs.map +0 -1
  391. package/template/apps/web/node_modules/better-call/dist/adapters/node/request.d.cts +0 -16
  392. package/template/apps/web/node_modules/better-call/dist/adapters/node/request.d.mts +0 -16
  393. package/template/apps/web/node_modules/better-call/dist/adapters/node/request.mjs +0 -178
  394. package/template/apps/web/node_modules/better-call/dist/adapters/node/request.mjs.map +0 -1
  395. package/template/apps/web/node_modules/better-call/dist/client.cjs +0 -23
  396. package/template/apps/web/node_modules/better-call/dist/client.cjs.map +0 -1
  397. package/template/apps/web/node_modules/better-call/dist/client.d.cts +0 -53
  398. package/template/apps/web/node_modules/better-call/dist/client.d.mts +0 -53
  399. package/template/apps/web/node_modules/better-call/dist/client.mjs +0 -14
  400. package/template/apps/web/node_modules/better-call/dist/client.mjs.map +0 -1
  401. package/template/apps/web/node_modules/better-call/dist/context.cjs +0 -103
  402. package/template/apps/web/node_modules/better-call/dist/context.cjs.map +0 -1
  403. package/template/apps/web/node_modules/better-call/dist/context.d.cts +0 -341
  404. package/template/apps/web/node_modules/better-call/dist/context.d.mts +0 -341
  405. package/template/apps/web/node_modules/better-call/dist/context.mjs +0 -103
  406. package/template/apps/web/node_modules/better-call/dist/context.mjs.map +0 -1
  407. package/template/apps/web/node_modules/better-call/dist/cookies.cjs +0 -87
  408. package/template/apps/web/node_modules/better-call/dist/cookies.cjs.map +0 -1
  409. package/template/apps/web/node_modules/better-call/dist/cookies.d.cts +0 -103
  410. package/template/apps/web/node_modules/better-call/dist/cookies.d.mts +0 -103
  411. package/template/apps/web/node_modules/better-call/dist/cookies.mjs +0 -84
  412. package/template/apps/web/node_modules/better-call/dist/cookies.mjs.map +0 -1
  413. package/template/apps/web/node_modules/better-call/dist/crypto.cjs +0 -39
  414. package/template/apps/web/node_modules/better-call/dist/crypto.cjs.map +0 -1
  415. package/template/apps/web/node_modules/better-call/dist/crypto.mjs +0 -36
  416. package/template/apps/web/node_modules/better-call/dist/crypto.mjs.map +0 -1
  417. package/template/apps/web/node_modules/better-call/dist/endpoint.cjs +0 -70
  418. package/template/apps/web/node_modules/better-call/dist/endpoint.cjs.map +0 -1
  419. package/template/apps/web/node_modules/better-call/dist/endpoint.d.cts +0 -475
  420. package/template/apps/web/node_modules/better-call/dist/endpoint.d.mts +0 -475
  421. package/template/apps/web/node_modules/better-call/dist/endpoint.mjs +0 -70
  422. package/template/apps/web/node_modules/better-call/dist/endpoint.mjs.map +0 -1
  423. package/template/apps/web/node_modules/better-call/dist/error.cjs +0 -141
  424. package/template/apps/web/node_modules/better-call/dist/error.cjs.map +0 -1
  425. package/template/apps/web/node_modules/better-call/dist/error.d.cts +0 -103
  426. package/template/apps/web/node_modules/better-call/dist/error.d.mts +0 -103
  427. package/template/apps/web/node_modules/better-call/dist/error.mjs +0 -133
  428. package/template/apps/web/node_modules/better-call/dist/error.mjs.map +0 -1
  429. package/template/apps/web/node_modules/better-call/dist/helper.d.cts +0 -12
  430. package/template/apps/web/node_modules/better-call/dist/helper.d.mts +0 -12
  431. package/template/apps/web/node_modules/better-call/dist/index.cjs +0 -28
  432. package/template/apps/web/node_modules/better-call/dist/index.d.cts +0 -11
  433. package/template/apps/web/node_modules/better-call/dist/index.d.mts +0 -11
  434. package/template/apps/web/node_modules/better-call/dist/index.mjs +0 -10
  435. package/template/apps/web/node_modules/better-call/dist/middleware.cjs +0 -52
  436. package/template/apps/web/node_modules/better-call/dist/middleware.cjs.map +0 -1
  437. package/template/apps/web/node_modules/better-call/dist/middleware.d.cts +0 -123
  438. package/template/apps/web/node_modules/better-call/dist/middleware.d.mts +0 -123
  439. package/template/apps/web/node_modules/better-call/dist/middleware.mjs +0 -52
  440. package/template/apps/web/node_modules/better-call/dist/middleware.mjs.map +0 -1
  441. package/template/apps/web/node_modules/better-call/dist/node.cjs +0 -18
  442. package/template/apps/web/node_modules/better-call/dist/node.cjs.map +0 -1
  443. package/template/apps/web/node_modules/better-call/dist/node.d.cts +0 -9
  444. package/template/apps/web/node_modules/better-call/dist/node.d.mts +0 -9
  445. package/template/apps/web/node_modules/better-call/dist/node.mjs +0 -15
  446. package/template/apps/web/node_modules/better-call/dist/node.mjs.map +0 -1
  447. package/template/apps/web/node_modules/better-call/dist/openapi.cjs +0 -191
  448. package/template/apps/web/node_modules/better-call/dist/openapi.cjs.map +0 -1
  449. package/template/apps/web/node_modules/better-call/dist/openapi.d.cts +0 -113
  450. package/template/apps/web/node_modules/better-call/dist/openapi.d.mts +0 -113
  451. package/template/apps/web/node_modules/better-call/dist/openapi.mjs +0 -189
  452. package/template/apps/web/node_modules/better-call/dist/openapi.mjs.map +0 -1
  453. package/template/apps/web/node_modules/better-call/dist/router.cjs +0 -118
  454. package/template/apps/web/node_modules/better-call/dist/router.cjs.map +0 -1
  455. package/template/apps/web/node_modules/better-call/dist/router.d.cts +0 -103
  456. package/template/apps/web/node_modules/better-call/dist/router.d.mts +0 -103
  457. package/template/apps/web/node_modules/better-call/dist/router.mjs +0 -117
  458. package/template/apps/web/node_modules/better-call/dist/router.mjs.map +0 -1
  459. package/template/apps/web/node_modules/better-call/dist/standard-schema.d.cts +0 -59
  460. package/template/apps/web/node_modules/better-call/dist/standard-schema.d.mts +0 -59
  461. package/template/apps/web/node_modules/better-call/dist/to-response.cjs +0 -153
  462. package/template/apps/web/node_modules/better-call/dist/to-response.cjs.map +0 -1
  463. package/template/apps/web/node_modules/better-call/dist/to-response.d.cts +0 -12
  464. package/template/apps/web/node_modules/better-call/dist/to-response.d.mts +0 -12
  465. package/template/apps/web/node_modules/better-call/dist/to-response.mjs +0 -153
  466. package/template/apps/web/node_modules/better-call/dist/to-response.mjs.map +0 -1
  467. package/template/apps/web/node_modules/better-call/dist/utils.cjs +0 -86
  468. package/template/apps/web/node_modules/better-call/dist/utils.cjs.map +0 -1
  469. package/template/apps/web/node_modules/better-call/dist/utils.mjs +0 -82
  470. package/template/apps/web/node_modules/better-call/dist/utils.mjs.map +0 -1
  471. package/template/apps/web/node_modules/better-call/dist/validator.cjs +0 -58
  472. package/template/apps/web/node_modules/better-call/dist/validator.cjs.map +0 -1
  473. package/template/apps/web/node_modules/better-call/dist/validator.mjs +0 -57
  474. package/template/apps/web/node_modules/better-call/dist/validator.mjs.map +0 -1
  475. package/template/apps/web/node_modules/better-call/package.json +0 -96
  476. package/template/apps/web/node_modules/set-cookie-parser/LICENSE +0 -21
  477. package/template/apps/web/node_modules/set-cookie-parser/README.md +0 -169
  478. package/template/apps/web/node_modules/set-cookie-parser/dist/.eslintrc.cjs +0 -16
  479. package/template/apps/web/node_modules/set-cookie-parser/dist/set-cookie.cjs +0 -260
  480. package/template/apps/web/node_modules/set-cookie-parser/lib/set-cookie.d.ts +0 -119
  481. package/template/apps/web/node_modules/set-cookie-parser/lib/set-cookie.js +0 -265
  482. package/template/apps/web/node_modules/set-cookie-parser/package.json +0 -61
@@ -1,1610 +0,0 @@
1
- import type { Database as BunDatabase } from "bun:sqlite";
2
- import type { DatabaseSync } from "node:sqlite";
3
- import type { D1Database } from "@cloudflare/workers-types";
4
- import type { CookieOptions } from "better-call";
5
- import type {
6
- Dialect,
7
- Kysely,
8
- MysqlPool,
9
- PostgresPool,
10
- SqliteDatabase,
11
- } from "kysely";
12
- import type { AuthMiddleware } from "../api";
13
- import type {
14
- Account,
15
- DBFieldAttribute,
16
- ModelNames,
17
- RateLimit,
18
- SecondaryStorage,
19
- Session,
20
- User,
21
- Verification,
22
- } from "../db";
23
- import type { DBAdapterDebugLogOption, DBAdapterInstance } from "../db/adapter";
24
- import type { BaseAccount } from "../db/schema/account";
25
- import type { BaseRateLimit } from "../db/schema/rate-limit";
26
- import type { BaseSession } from "../db/schema/session";
27
- import type { BaseUser } from "../db/schema/user";
28
- import type { BaseVerification } from "../db/schema/verification";
29
- import type { Logger } from "../env";
30
- import type { SocialProviderList, SocialProviders } from "../social-providers";
31
- import type { AuthContext, GenericEndpointContext } from "./context";
32
- import type { Awaitable, LiteralString, LiteralUnion } from "./helper";
33
- import type { BetterAuthPlugin } from "./plugin";
34
-
35
- type KyselyDatabaseType = "postgres" | "mysql" | "sqlite" | "mssql";
36
- type Optional<T> = {
37
- [P in keyof T]?: T[P] | undefined;
38
- };
39
-
40
- export type StoreIdentifierOption =
41
- | "plain"
42
- | "hashed"
43
- | { hash: (identifier: string) => Promise<string> };
44
-
45
- export type GenerateIdFn = (options: {
46
- model: ModelNames;
47
- size?: number | undefined;
48
- }) => string | false;
49
-
50
- /**
51
- * Configuration for dynamic base URL resolution.
52
- * Allows Better Auth to work with multiple domains (e.g., Vercel preview deployments).
53
- */
54
- export type DynamicBaseURLConfig = {
55
- /**
56
- * List of allowed hostnames. Supports wildcard patterns.
57
- *
58
- * The derived host from the request will be validated against this list.
59
- * Uses the same wildcard matching as `trustedOrigins`.
60
- *
61
- * @example
62
- * ```ts
63
- * allowedHosts: [
64
- * "myapp.com", // Exact match
65
- * "*.vercel.app", // Any Vercel preview
66
- * "preview-*.myapp.com" // Pattern match
67
- * ]
68
- * ```
69
- */
70
- allowedHosts: string[];
71
-
72
- /**
73
- * Fallback URL to use if the derived host doesn't match any allowed host.
74
- * If not set, Better Auth will throw an error when the host doesn't match.
75
- *
76
- * @example "https://myapp.com"
77
- */
78
- fallback?: string | undefined;
79
-
80
- /**
81
- * Protocol to use when constructing the URL.
82
- * - `"https"`: Always use HTTPS (recommended for production)
83
- * - `"http"`: Always use HTTP (for local development)
84
- * - `"auto"`: Derive from `x-forwarded-proto` header or default to HTTPS
85
- *
86
- * @default "auto"
87
- */
88
- protocol?: "http" | "https" | "auto" | undefined;
89
- };
90
-
91
- /**
92
- * Base URL configuration.
93
- * Can be a static string or a dynamic config for multi-domain deployments.
94
- */
95
- export type BaseURLConfig = string | DynamicBaseURLConfig;
96
-
97
- export interface BetterAuthRateLimitStorage {
98
- get: (key: string) => Promise<RateLimit | null | undefined>;
99
- set: (
100
- key: string,
101
- value: RateLimit,
102
- update?: boolean | undefined,
103
- ) => Promise<void>;
104
- }
105
-
106
- export type BetterAuthRateLimitRule = {
107
- /**
108
- * Default window to use for rate limiting. The value
109
- * should be in seconds.
110
- *
111
- * @default 10 seconds
112
- */
113
- window: number;
114
- /**
115
- * The default maximum number of requests allowed within the window.
116
- *
117
- * @default 100 requests
118
- */
119
- max: number;
120
- };
121
-
122
- export type BetterAuthDBOptions<
123
- ModelName extends string,
124
- Keys extends string = string,
125
- > = {
126
- /**
127
- * The name of the model. Defaults to the model name.
128
- */
129
- modelName?: ModelName | LiteralString;
130
- /**
131
- * Map fields to database columns
132
- */
133
- fields?: Partial<Record<Exclude<Keys, "id">, string>>;
134
- /**
135
- * Additional fields for the model
136
- */
137
- additionalFields?: {
138
- [Key in Exclude<string, Keys | "id">]: DBFieldAttribute;
139
- };
140
- };
141
-
142
- export type BetterAuthRateLimitOptions = Optional<BetterAuthRateLimitRule> &
143
- Omit<
144
- BetterAuthDBOptions<"rateLimit", keyof BaseRateLimit>,
145
- "additionalFields"
146
- > & {
147
- /**
148
- * By default, rate limiting is only
149
- * enabled on production.
150
- */
151
- enabled?: boolean | undefined;
152
- /**
153
- * Custom rate limit rules to apply to
154
- * specific paths.
155
- */
156
- customRules?:
157
- | {
158
- [key: string]:
159
- | BetterAuthRateLimitRule
160
- | false
161
- | ((
162
- request: Request,
163
- currentRule: BetterAuthRateLimitRule,
164
- ) => Awaitable<false | BetterAuthRateLimitRule>);
165
- }
166
- | undefined;
167
- /**
168
- * Storage configuration
169
- *
170
- * By default, rate limiting is stored in memory. If you passed a
171
- * secondary storage, rate limiting will be stored in the secondary
172
- * storage.
173
- *
174
- * @default "memory"
175
- */
176
- storage?: ("memory" | "database" | "secondary-storage") | undefined;
177
- /**
178
- * custom storage configuration.
179
- *
180
- * NOTE: If custom storage is used storage
181
- * is ignored
182
- */
183
- customStorage?: BetterAuthRateLimitStorage;
184
- };
185
-
186
- export type BetterAuthAdvancedOptions = {
187
- /**
188
- * Ip address configuration
189
- */
190
- ipAddress?:
191
- | {
192
- /**
193
- * List of headers to use for ip address
194
- *
195
- * Ip address is used for rate limiting and session tracking
196
- *
197
- * @example ["x-client-ip", "x-forwarded-for", "cf-connecting-ip"]
198
- *
199
- * @default
200
- * @link https://github.com/better-auth/better-auth/blob/main/packages/better-auth/src/utils/get-request-ip.ts#L8
201
- */
202
- ipAddressHeaders?: string[];
203
- /**
204
- * Disable ip tracking
205
- *
206
- * ⚠︎ This is a security risk and it may expose your application to abuse
207
- */
208
- disableIpTracking?: boolean;
209
- /**
210
- * IPv6 subnet prefix length for rate limiting.
211
- * IPv6 addresses will be normalized to this subnet.
212
- *
213
- * @default 64
214
- */
215
- ipv6Subnet?: 128 | 64 | 48 | 32;
216
- }
217
- | undefined;
218
- /**
219
- * Force cookies to always use the `Secure` attribute. By default,
220
- * cookies are secure in production environments. Set this to `true`
221
- * to enforce secure cookies in all environments.
222
- *
223
- * @default false
224
- */
225
- useSecureCookies?: boolean | undefined;
226
- /**
227
- * Disable all CSRF protection.
228
- *
229
- * When enabled, this disables:
230
- * - Origin header validation when cookies are present
231
- * - Fetch Metadata checks (Sec-Fetch-Site, Sec-Fetch-Mode, Sec-Fetch-Dest)
232
- * - Cross-site navigation blocking for first-login scenarios
233
- *
234
- * ⚠︎ This is a security risk and it may expose your application to
235
- * CSRF attacks
236
- *
237
- * @default false
238
- */
239
- disableCSRFCheck?: boolean | undefined;
240
- /**
241
- * Disable URL validation against trustedOrigins.
242
- *
243
- * When enabled, this disables validation of:
244
- * - callbackURL
245
- * - redirectTo
246
- * - errorCallbackURL
247
- * - newUserCallbackURL
248
- *
249
- * ⚠︎ This may allow open redirects and could lead to security
250
- * vulnerabilities.
251
- *
252
- * @default false
253
- */
254
- disableOriginCheck?: boolean | undefined;
255
- /**
256
- * Configure cookies to be cross subdomains
257
- */
258
- crossSubDomainCookies?:
259
- | {
260
- /**
261
- * Enable cross subdomain cookies
262
- */
263
- enabled: boolean;
264
- /**
265
- * Additional cookies to be shared across subdomains
266
- */
267
- additionalCookies?: string[];
268
- /**
269
- * The domain to use for the cookies
270
- *
271
- * By default, the domain will be the root
272
- * domain from the base URL.
273
- */
274
- domain?: string;
275
- }
276
- | undefined;
277
- /*
278
- * Allows you to change default cookie names and attributes
279
- *
280
- * default cookie names:
281
- * - "session_token"
282
- * - "session_data"
283
- * - "dont_remember"
284
- * - "account_data"
285
- *
286
- * plugins can also add additional cookies
287
- */
288
- cookies?:
289
- | {
290
- [key: string]: {
291
- name?: string;
292
- attributes?: CookieOptions;
293
- };
294
- }
295
- | undefined;
296
- defaultCookieAttributes?: CookieOptions | undefined;
297
- /**
298
- * Prefix for cookies. If a cookie name is provided
299
- * in cookies config, this will be overridden.
300
- *
301
- * @default
302
- * ```txt
303
- * "appName" -> which defaults to "better-auth"
304
- * ```
305
- */
306
- cookiePrefix?: string | undefined;
307
- /**
308
- * Database configuration.
309
- */
310
- database?:
311
- | {
312
- /**
313
- * The default number of records to return from the database
314
- * when using the `findMany` adapter method.
315
- *
316
- * @default 100
317
- */
318
- defaultFindManyLimit?: number;
319
- /**
320
- * Custom generateId function.
321
- *
322
- * If not provided, random ids will be generated.
323
- * If set to false, the database's auto generated id
324
- * will be used.
325
- *
326
- * If set to "serial", the database's auto generated
327
- * id will be used.
328
- *
329
- * If set to "uuid", we generate a random UUID for
330
- * the id. If postgres, we use the `gen_random_uuid()
331
- * ` function. If mysql or mssql, we use the `uuid()`
332
- * function.
333
- */
334
- generateId?: GenerateIdFn | false | "serial" | "uuid";
335
- }
336
- | undefined;
337
- /**
338
- * Trusted proxy headers
339
- *
340
-
341
- * - `x-forwarded-host`
342
- * - `x-forwarded-proto`
343
- *
344
- * If set to `true` and no `baseURL` option is provided, we will use the headers to infer the
345
- * base URL.
346
- *
347
- * ⚠︎ This may expose your application to security vulnerabilities if not
348
- * used correctly. Please use this with caution.
349
- */
350
- trustedProxyHeaders?: boolean | undefined;
351
- /**
352
- * Configure background task handling for deferred operations.
353
- *
354
- * Background tasks allow non-critical operations (like cleanup, analytics,
355
- * or timing-attack mitigation) to run after the response is sent.
356
- *
357
- * Use `waitUntil` from `@vercel/functions` on Vercel,
358
- * or `ctx.waitUntil` on Cloudflare Workers.
359
- *
360
- * @example
361
- * // Vercel
362
- * import { waitUntil } from "@vercel/functions";
363
- * advanced: { backgroundTasks: { handler: waitUntil } }
364
- *
365
- * @example
366
- * // Cloudflare Workers (with AsyncLocalStorage)
367
- * advanced: {
368
- * backgroundTasks: {
369
- * handler: (p) => execCtxStorage.getStore()?.waitUntil(p)
370
- * }
371
- * }
372
- */
373
- backgroundTasks?: {
374
- handler: (promise: Promise<unknown>) => void;
375
- };
376
- /**
377
- * Skip trailing slashes in API routes.
378
- *
379
- * When enabled, requests with trailing slashes (e.g., `/api/auth/session/`)
380
- * will be handled the same as requests without (e.g., `/api/auth/session`).
381
- *
382
- * @default false
383
- */
384
- skipTrailingSlashes?: boolean;
385
- };
386
-
387
- export type BetterAuthOptions = {
388
- /**
389
- * The name of your application. Used as a display name in contexts
390
- * where your app needs to be identified — for example, as the default
391
- * issuer name in authenticator apps when users set up 2FA/TOTP.
392
- *
393
- * Can also be set via the `APP_NAME` environment variable.
394
- *
395
- * @default "Better Auth"
396
- */
397
- appName?: string | undefined;
398
- /**
399
- * Base URL for the Better Auth. This is typically the
400
- * root URL where your application server is hosted.
401
- *
402
- * Can be configured as:
403
- * - A static string: `"https://myapp.com"`
404
- * - A dynamic config with allowed hosts for multi-domain deployments
405
- *
406
- * If not explicitly set, the system will check environment variables:
407
- * `BETTER_AUTH_URL`, `NEXT_PUBLIC_BETTER_AUTH_URL`, etc.
408
- *
409
- * @example
410
- * ```ts
411
- * // Static URL
412
- * baseURL: "https://myapp.com"
413
- *
414
- * // Dynamic with allowed hosts (for Vercel, multi-domain, etc.)
415
- * baseURL: {
416
- * allowedHosts: ["myapp.com", "*.vercel.app", "preview-*.myapp.com"],
417
- * fallback: "https://myapp.com"
418
- * }
419
- * ```
420
- */
421
- baseURL?: BaseURLConfig | undefined;
422
- /**
423
- * Base path for the Better Auth. This is typically
424
- * the path where the
425
- * Better Auth routes are mounted.
426
- *
427
- * @default "/api/auth"
428
- */
429
- basePath?: string | undefined;
430
- /**
431
- * The secret to use for encryption,
432
- * signing and hashing.
433
- *
434
- * By default Better Auth will look for
435
- * the following environment variables:
436
- * process.env.BETTER_AUTH_SECRET,
437
- * process.env.AUTH_SECRET
438
- * If none of these environment
439
- * variables are set,
440
- * it will default to
441
- * "better-auth-secret-123456789".
442
- *
443
- * on production if it's not set
444
- * it will throw an error.
445
- *
446
- * you can generate a good secret
447
- * using the following command:
448
- * @example
449
- * ```bash
450
- * openssl rand -base64 32
451
- * ```
452
- */
453
- secret?: string | undefined;
454
- /**
455
- * Versioned secrets for non-destructive secret rotation.
456
- * When set, encryption uses an envelope format with key IDs.
457
- * First entry is the current key used for new encryption.
458
- * Remaining entries are decryption-only (previous rotations).
459
- *
460
- * Can also be set via BETTER_AUTH_SECRETS env var:
461
- * `BETTER_AUTH_SECRETS=2:base64secret,1:base64secret`
462
- *
463
- * When set, `secret` is only used as legacy fallback
464
- * for decrypting bare-hex payloads that predate the envelope format.
465
- */
466
- secrets?: Array<{ version: number; value: string }> | undefined;
467
- /**
468
- * Database configuration
469
- */
470
- database?:
471
- | (
472
- | PostgresPool
473
- | MysqlPool
474
- | SqliteDatabase
475
- | Dialect
476
- | DBAdapterInstance
477
- | BunDatabase
478
- | DatabaseSync
479
- | D1Database
480
- | {
481
- dialect: Dialect;
482
- type: KyselyDatabaseType;
483
- /**
484
- * casing for table names
485
- *
486
- * @default "camel"
487
- */
488
- casing?: "snake" | "camel";
489
- /**
490
- * Enable debug logs for the adapter
491
- *
492
- * @default false
493
- */
494
- debugLogs?: DBAdapterDebugLogOption;
495
- /**
496
- * Whether to execute multiple operations in a transaction.
497
- * If the database doesn't support transactions,
498
- * set this to `false` and operations will be executed sequentially.
499
- *
500
- * @default false
501
- */
502
- transaction?: boolean;
503
- }
504
- | {
505
- /**
506
- * Kysely instance
507
- */
508
- db: Kysely<any>;
509
- /**
510
- * Database type between postgres, mysql and sqlite
511
- */
512
- type: KyselyDatabaseType;
513
- /**
514
- * casing for table names
515
- *
516
- * @default "camel"
517
- */
518
- casing?: "snake" | "camel";
519
- /**
520
- * Enable debug logs for the adapter
521
- *
522
- * @default false
523
- */
524
- debugLogs?: DBAdapterDebugLogOption;
525
- /**
526
- * Whether to execute multiple operations in a transaction.
527
- * If the database doesn't support transactions,
528
- * set this to `false` and operations will be executed sequentially.
529
- *
530
- * @default false
531
- */
532
- transaction?: boolean;
533
- }
534
- )
535
- | undefined;
536
- /**
537
- * Secondary storage configuration
538
- *
539
- * This is used to store session and rate limit data.
540
- */
541
- secondaryStorage?: SecondaryStorage | undefined;
542
- /**
543
- * Email verification configuration
544
- */
545
- emailVerification?:
546
- | {
547
- /**
548
- * Send a verification email
549
- * @param data the data object
550
- * @param request the request object
551
- */
552
- sendVerificationEmail?: (
553
- /**
554
- * @param user the user to send the
555
- * verification email to
556
- * @param url the URL to send the verification email to
557
- * it contains the token as well
558
- * @param token the token to send the verification email to
559
- */
560
- data: {
561
- user: User;
562
- url: string;
563
- token: string;
564
- },
565
- /**
566
- * The request object
567
- */
568
- request?: Request,
569
- ) => Promise<void>;
570
- /**
571
- * Send a verification email automatically after sign up.
572
- *
573
- * - `true`: Always send verification email on sign up
574
- * - `false`: Never send verification email on sign up
575
- * - `undefined`: Follows `requireEmailVerification` behavior
576
- *
577
- * @default undefined
578
- */
579
- sendOnSignUp?: boolean;
580
- /**
581
- * Send a verification email automatically
582
- * on sign in when the user's email is not verified
583
- *
584
- * @default false
585
- */
586
- sendOnSignIn?: boolean;
587
- /**
588
- * Auto signin the user after they verify their email
589
- */
590
- autoSignInAfterVerification?: boolean;
591
- /**
592
- * Number of seconds the verification token is
593
- * valid for.
594
- * @default 3600 seconds (1 hour)
595
- */
596
- expiresIn?: number;
597
- /**
598
- * A function that is called before a user verifies their email
599
- * @param user the user that verified their email
600
- * @param request the request object
601
- */
602
- beforeEmailVerification?: (
603
- user: User,
604
- request?: Request,
605
- ) => Promise<void>;
606
- /**
607
- * A function that is called when a user's email is updated to verified
608
- * @param user the user that verified their email
609
- * @param request the request object
610
- */
611
- afterEmailVerification?: (
612
- user: User,
613
- request?: Request,
614
- ) => Promise<void>;
615
- }
616
- | undefined;
617
- /**
618
- * Email and password authentication
619
- */
620
- emailAndPassword?:
621
- | {
622
- /**
623
- * Enable email and password authentication
624
- *
625
- * @default false
626
- */
627
- enabled: boolean;
628
- /**
629
- * Disable email and password sign up
630
- *
631
- * @default false
632
- */
633
- disableSignUp?: boolean;
634
- /**
635
- * Require email verification before a session
636
- * can be created for the user.
637
- *
638
- * if the user is not verified, the user will not be able to sign in
639
- * and on sign in attempts, the user will be prompted to verify their email.
640
- */
641
- requireEmailVerification?: boolean;
642
- /**
643
- * The maximum length of the password.
644
- *
645
- * @default 128
646
- */
647
- maxPasswordLength?: number;
648
- /**
649
- * The minimum length of the password.
650
- *
651
- * @default 8
652
- */
653
- minPasswordLength?: number;
654
- /**
655
- * send reset password
656
- */
657
- sendResetPassword?: (
658
- /**
659
- * @param user the user to send the
660
- * reset password email to
661
- * @param url the URL to send the reset password email to
662
- * @param token the token to send to the user (could be used instead of sending the url
663
- * if you need to redirect the user to custom route)
664
- */
665
- data: { user: User; url: string; token: string },
666
- /**
667
- * The request object
668
- */
669
- request?: Request,
670
- ) => Promise<void>;
671
- /**
672
- * Number of seconds the reset password token is
673
- * valid for.
674
- * @default 1 hour (60 * 60)
675
- */
676
- resetPasswordTokenExpiresIn?: number;
677
- /**
678
- * A callback function that is triggered
679
- * when a user's password is changed successfully.
680
- */
681
- onPasswordReset?: (
682
- data: { user: User },
683
- request?: Request,
684
- ) => Promise<void>;
685
- /**
686
- * Password hashing and verification
687
- *
688
- * By default Scrypt is used for password hashing and
689
- * verification. You can provide your own hashing and
690
- * verification function. if you want to use a
691
- * different algorithm.
692
- */
693
- password?: {
694
- hash?: (password: string) => Promise<string>;
695
- verify?: (data: {
696
- hash: string;
697
- password: string;
698
- }) => Promise<boolean>;
699
- };
700
- /**
701
- * Automatically sign in the user after sign up
702
- *
703
- * @default true
704
- */
705
- autoSignIn?: boolean;
706
- /**
707
- * Whether to revoke all other sessions when resetting password
708
- * @default false
709
- */
710
- revokeSessionsOnPasswordReset?: boolean;
711
- /**
712
- * A callback function that is triggered when a user tries to sign up
713
- * with an email that already exists. Useful for notifying the existing user
714
- * that someone attempted to register with their email.
715
- *
716
- * This is only called when `requireEmailVerification: true` or `autoSignIn: false`.
717
- */
718
- onExistingUserSignUp?: (
719
- /**
720
- * @param user the existing user from the database
721
- */
722
- data: { user: User },
723
- request?: Request,
724
- ) => Promise<void>;
725
- /**
726
- * Build a custom synthetic user for email enumeration
727
- * protection. When a sign-up attempt is made with an
728
- * email that already exists, this function is called
729
- * to build the fake user response.
730
- *
731
- * Use this when plugins add fields to the user table
732
- * (e.g. admin plugin adds `role`, `banned`, etc.)
733
- * to ensure the fake response is indistinguishable
734
- * from a real sign-up.
735
- *
736
- * @example
737
- * ```ts
738
- * customSyntheticUser: ({ coreFields, additionalFields, id }) => ({
739
- * ...coreFields,
740
- * role: "user",
741
- * banned: false,
742
- * banReason: null,
743
- * banExpires: null,
744
- * ...additionalFields,
745
- * id,
746
- * })
747
- * ```
748
- */
749
- customSyntheticUser?: (params: {
750
- /** Core user fields: name, email, emailVerified, image, createdAt, updatedAt */
751
- coreFields: {
752
- name: string;
753
- email: string;
754
- emailVerified: boolean;
755
- image: string | null;
756
- createdAt: Date;
757
- updatedAt: Date;
758
- };
759
- /** Processed additional fields from options.user.additionalFields (with defaults applied) */
760
- additionalFields: Record<string, unknown>;
761
- /** Generated user ID */
762
- id: string;
763
- }) => Record<string, unknown>;
764
- }
765
- | undefined;
766
- /**
767
- * list of social providers
768
- */
769
- socialProviders?: SocialProviders | undefined;
770
- /**
771
- * List of Better Auth plugins
772
- */
773
- plugins?: ([] | BetterAuthPlugin[]) | undefined;
774
- /**
775
- * User configuration
776
- */
777
- user?:
778
- | (BetterAuthDBOptions<"user", keyof BaseUser> & {
779
- /**
780
- * Changing email configuration
781
- */
782
- changeEmail?: {
783
- /**
784
- * Enable changing email
785
- * @default false
786
- */
787
- enabled: boolean;
788
- /**
789
- * Send a confirmation email to the old email address when the user changes their email.
790
- * @param data the data object
791
- * @param request the request object
792
- */
793
- sendChangeEmailConfirmation?: (
794
- data: {
795
- user: User;
796
- newEmail: string;
797
- url: string;
798
- token: string;
799
- },
800
- request?: Request,
801
- ) => Promise<void>;
802
- /**
803
- * Update the email without verification if the user is not verified.
804
- * @default false
805
- */
806
- updateEmailWithoutVerification?: boolean;
807
- };
808
- /**
809
- * User deletion configuration
810
- */
811
- deleteUser?: {
812
- /**
813
- * Enable user deletion
814
- */
815
- enabled?: boolean;
816
- /**
817
- * Send a verification email when the user deletes their account.
818
- *
819
- * if this is not set, the user will be deleted immediately.
820
- * @param data the data object
821
- * @param request the request object
822
- */
823
- sendDeleteAccountVerification?: (
824
- data: {
825
- user: User;
826
- url: string;
827
- token: string;
828
- },
829
- request?: Request,
830
- ) => Promise<void>;
831
- /**
832
- * A function that is called before a user is deleted.
833
- *
834
- * to interrupt with error you can throw `APIError`
835
- */
836
- beforeDelete?: (user: User, request?: Request) => Promise<void>;
837
- /**
838
- * A function that is called after a user is deleted.
839
- *
840
- * This is useful for cleaning up user data
841
- */
842
- afterDelete?: (user: User, request?: Request) => Promise<void>;
843
- /**
844
- * The expiration time for the delete token.
845
- *
846
- * @default 1 day (60 * 60 * 24) in seconds
847
- */
848
- deleteTokenExpiresIn?: number;
849
- };
850
- })
851
- | undefined;
852
- session?:
853
- | (BetterAuthDBOptions<"session", keyof BaseSession> & {
854
- /**
855
- * Expiration time for the session token. The value
856
- * should be in seconds.
857
- * @default 7 days (60 * 60 * 24 * 7)
858
- */
859
- expiresIn?: number;
860
- /**
861
- * How often the session should be refreshed. The value
862
- * should be in seconds.
863
- * If set 0 the session will be refreshed every time it is used.
864
- * @default 1 day (60 * 60 * 24)
865
- */
866
- updateAge?: number;
867
- /**
868
- * Disable session refresh so that the session is not updated
869
- * regardless of the `updateAge` option.
870
- *
871
- * @default false
872
- */
873
- disableSessionRefresh?: boolean;
874
- /**
875
- * Defer session refresh writes to POST requests.
876
- * When enabled, GET is read-only and POST performs refresh.
877
- * Useful for read-replica database setups.
878
- *
879
- * @default false
880
- */
881
- deferSessionRefresh?: boolean;
882
- /**
883
- * By default if secondary storage is provided
884
- * the session is stored in the secondary storage.
885
- *
886
- * Set this to true to store the session in the database
887
- * as well.
888
- *
889
- * Reads are always done from the secondary storage.
890
- *
891
- * @default false
892
- */
893
- storeSessionInDatabase?: boolean;
894
- /**
895
- * By default, sessions are deleted from the database when secondary storage
896
- * is provided when session is revoked.
897
- *
898
- * Set this to true to preserve session records in the database,
899
- * even if they are deleted from the secondary storage.
900
- *
901
- * @default false
902
- */
903
- preserveSessionInDatabase?: boolean;
904
- /**
905
- * Enable caching session in cookie
906
- */
907
- cookieCache?: {
908
- /**
909
- * max age of the cookie
910
- * @default 5 minutes (5 * 60)
911
- */
912
- maxAge?: number;
913
- /**
914
- * Enable caching session in cookie
915
- * @default false
916
- */
917
- enabled?: boolean;
918
- /**
919
- * Strategy for encoding/decoding cookie cache
920
- *
921
- * - "compact": Uses base64url encoding with HMAC-SHA256 signature (compact format, no JWT spec overhead)
922
- * - "jwt": Uses JWT with HMAC signature (no encryption, follows JWT spec)
923
- * - "jwe": Uses JWE (JSON Web Encryption) with A256CBC-HS512 and HKDF key derivation for secure encrypted tokens
924
- *
925
- * @default "compact"
926
- */
927
- strategy?: "compact" | "jwt" | "jwe";
928
- /**
929
- * Controls stateless cookie cache refresh behavior.
930
- *
931
- * When enabled, the cookie cache will be automatically refreshed before expiry
932
- * WITHOUT querying the database. This is essential for fully stateless or DB-less scenarios.
933
- *
934
- * - `false`: Disable automatic refresh. Cache is only invalidated when it reaches maxAge expiry.
935
- * - `true`: Enable automatic refresh with default settings (refreshes when 80% of maxAge is reached).
936
- * - `object`: Custom refresh configuration with either `updateAge` or `shouldRefresh` function
937
- *
938
- * Note: When the cache expires (reaches maxAge), it will attempt to fetch from database if available.
939
- * The refreshCache option is specifically for refreshing BEFORE expiry in a stateless manner.
940
- *
941
- * @default false
942
- */
943
- refreshCache?:
944
- | boolean
945
- | {
946
- /**
947
- * Time in seconds before expiry when the cache should be refreshed.
948
- * For example, if maxAge is 300 (5 minutes) and updateAge is 60,
949
- * the cache will be refreshed when it has 60 seconds left before expiry.
950
- *
951
- * @default 20% of maxAge
952
- */
953
- updateAge?: number;
954
- };
955
- /**
956
- * Version of the cookie cache
957
- *
958
- * If a cookie cache version is changed, all existing cookie caches with the old version
959
- * will be invalidated.
960
- *
961
- * It can be a string or a function that returns a string or a promise that returns a string.
962
- * If it's a function, it will be called with the session and user data
963
- *
964
- * @default "1"
965
- */
966
- version?:
967
- | string
968
- | ((
969
- session: Session & Record<string, any>,
970
- user: User & Record<string, any>,
971
- ) => string)
972
- | ((
973
- session: Session & Record<string, any>,
974
- user: User & Record<string, any>,
975
- ) => Promise<string>);
976
- };
977
- /**
978
- * The age of the session to consider it fresh.
979
- *
980
- * This is used to check if the session is fresh
981
- * for sensitive operations. (e.g. deleting an account)
982
- *
983
- * If the session is not fresh, the user should be prompted
984
- * to sign in again.
985
- *
986
- * If set to 0, the session will be considered fresh every time. (⚠︎ not recommended)
987
- *
988
- * @default 1 day (60 * 60 * 24)
989
- */
990
- freshAge?: number;
991
- })
992
- | undefined;
993
- account?:
994
- | (BetterAuthDBOptions<"account", keyof BaseAccount> & {
995
- /**
996
- * When enabled (true), the user account data (accessToken, idToken, refreshToken, etc.)
997
- * will be updated on sign in with the latest data from the provider.
998
- *
999
- * @default true
1000
- */
1001
- updateAccountOnSignIn?: boolean;
1002
- /**
1003
- * Configuration for account linking.
1004
- */
1005
- accountLinking?: {
1006
- /**
1007
- * Enable account linking
1008
- *
1009
- * @default true
1010
- */
1011
- enabled?: boolean;
1012
- /**
1013
- * Disable implicit account linking on sign-in.
1014
- *
1015
- * When enabled, accounts will not be automatically linked
1016
- * during OAuth sign-in, even if the email is verified or
1017
- * the provider is trusted. Users must explicitly link
1018
- * accounts using `linkSocial()` while authenticated.
1019
- *
1020
- * @default false
1021
- */
1022
- disableImplicitLinking?: boolean;
1023
- /**
1024
- * List of trusted providers. Can be a static array or a function
1025
- * that returns providers dynamically. The function is called
1026
- * during context init (with `request` undefined) and again
1027
- * on each request (with the incoming Request). It must be
1028
- * resilient to `request` being undefined.
1029
- *
1030
- * @example
1031
- * ```ts
1032
- * trustedProviders: ["google", "github"]
1033
- * ```
1034
- *
1035
- * @example
1036
- * ```ts
1037
- * trustedProviders: async (request) => {
1038
- * if (!request) return [];
1039
- * const providers = await getTrustedProvidersForTenant(request);
1040
- * return providers;
1041
- * }
1042
- * ```
1043
- */
1044
- trustedProviders?:
1045
- | Array<
1046
- LiteralUnion<
1047
- SocialProviderList[number] | "email-password",
1048
- string
1049
- >
1050
- >
1051
- | ((
1052
- request?: Request | undefined,
1053
- ) => Awaitable<
1054
- Array<
1055
- LiteralUnion<
1056
- SocialProviderList[number] | "email-password",
1057
- string
1058
- >
1059
- >
1060
- >);
1061
- /**
1062
- * If enabled (true), this will allow users to manually linking accounts with different email addresses than the main user.
1063
- *
1064
- * @default false
1065
- *
1066
- * ⚠️ Warning: enabling this might lead to account takeovers, so proceed with caution.
1067
- */
1068
- allowDifferentEmails?: boolean;
1069
- /**
1070
- * If enabled (true), this will allow users to unlink all accounts.
1071
- *
1072
- * @default false
1073
- */
1074
- allowUnlinkingAll?: boolean;
1075
- /**
1076
- * If enabled (true), this will update the user information based on the newly linked account
1077
- *
1078
- * @default false
1079
- */
1080
- updateUserInfoOnLink?: boolean;
1081
- };
1082
- /**
1083
- * Encrypt OAuth tokens
1084
- *
1085
- * By default, OAuth tokens (access tokens, refresh tokens, ID tokens) are stored in plain text in the database.
1086
- * This poses a security risk if your database is compromised, as attackers could gain access to user accounts
1087
- * on external services.
1088
- *
1089
- * When enabled, tokens are encrypted using AES-256-GCM before storage, providing protection against:
1090
- * - Database breaches and unauthorized access to raw token data
1091
- * - Internal threats from database administrators or compromised credentials
1092
- * - Token exposure in database backups and logs
1093
- * @default false
1094
- */
1095
- encryptOAuthTokens?: boolean;
1096
- /**
1097
- * Skip state cookie check
1098
- *
1099
- * ⚠︎ this has security implications and should only be enabled if you know what you are doing.
1100
- * @default false
1101
- */
1102
- skipStateCookieCheck?: boolean;
1103
- /**
1104
- * Strategy for storing OAuth state
1105
- *
1106
- * - "cookie": Store state in an encrypted cookie (stateless)
1107
- * - "database": Store state in the database
1108
- *
1109
- * @default "cookie"
1110
- */
1111
- storeStateStrategy?: "database" | "cookie";
1112
- /**
1113
- * Store account data after oauth flow on a cookie
1114
- *
1115
- * This is useful for database-less flow
1116
- *
1117
- * @default false
1118
- *
1119
- * @note This is automatically set to true if you haven't passed a database
1120
- */
1121
- storeAccountCookie?: boolean;
1122
- })
1123
- | undefined;
1124
- verification?:
1125
- | (BetterAuthDBOptions<"verification", keyof BaseVerification> & {
1126
- /**
1127
- * disable cleaning up expired values when a verification value is
1128
- * fetched
1129
- */
1130
- disableCleanup?: boolean;
1131
- /**
1132
- * How to store verification identifiers (tokens, OTPs, etc.)
1133
- *
1134
- * @example "hashed"
1135
- *
1136
- * @default "plain"
1137
- */
1138
- storeIdentifier?:
1139
- | StoreIdentifierOption
1140
- | {
1141
- default: StoreIdentifierOption;
1142
- overrides?: Record<string, StoreIdentifierOption>;
1143
- };
1144
- /**
1145
- * Store verification data in database even when secondary storage is configured.
1146
- * @default false
1147
- */
1148
- storeInDatabase?: boolean;
1149
- })
1150
- | undefined;
1151
- /**
1152
- * Additional trusted origins. By default, Better Auth trusts your
1153
- * app's {@link baseURL}. Use this option to allow additional origins
1154
- * (e.g. a separate frontend domain).
1155
- *
1156
- * Can be a static array, a function that returns origins dynamically,
1157
- * or use wildcard patterns (e.g. `"https://*.example.com"`).
1158
- *
1159
- * @param request - The request object.
1160
- * It'll be undefined if no request was
1161
- * made. Like during a create context call
1162
- * or `auth.api` call.
1163
- *
1164
- * Trusted origins will be dynamically
1165
- * calculated based on the request.
1166
- *
1167
- * @example
1168
- * ```ts
1169
- * trustedOrigins: async (request) => {
1170
- * return [
1171
- * "https://better-auth.com",
1172
- * "https://*.better-auth.com",
1173
- * request.headers.get("x-custom-origin")
1174
- * ];
1175
- * }
1176
- * ```
1177
- * @returns An array of trusted origins.
1178
- */
1179
- trustedOrigins?:
1180
- | (
1181
- | string[]
1182
- | ((
1183
- request?: Request | undefined,
1184
- ) => Awaitable<(string | undefined | null)[]>)
1185
- )
1186
- | undefined;
1187
- /**
1188
- * Rate limiting configuration
1189
- */
1190
- rateLimit?: BetterAuthRateLimitOptions | undefined;
1191
- /**
1192
- * Advanced options
1193
- */
1194
- advanced?: BetterAuthAdvancedOptions | undefined;
1195
- logger?: Logger | undefined;
1196
- /**
1197
- * allows you to define custom hooks that can be
1198
- * executed during lifecycle of core database
1199
- * operations.
1200
- */
1201
- databaseHooks?:
1202
- | {
1203
- /**
1204
- * User hooks
1205
- */
1206
- user?: {
1207
- create?: {
1208
- /**
1209
- * Hook that is called before a user is created.
1210
- * if the hook returns false, the user will not be created.
1211
- * If the hook returns an object, it'll be used instead of the original data
1212
- */
1213
- before?: (
1214
- user: User & Record<string, unknown>,
1215
- context: GenericEndpointContext | null,
1216
- ) => Promise<
1217
- | boolean
1218
- | void
1219
- | {
1220
- data: Optional<User> & Record<string, any>;
1221
- }
1222
- >;
1223
- /**
1224
- * Hook that is called after a user is created.
1225
- */
1226
- after?: (
1227
- user: User & Record<string, unknown>,
1228
- context: GenericEndpointContext | null,
1229
- ) => Promise<void>;
1230
- };
1231
- update?: {
1232
- /**
1233
- * Hook that is called before a user is updated.
1234
- * if the hook returns false, the user will not be updated.
1235
- * If the hook returns an object, it'll be used instead of the original data
1236
- */
1237
- before?: (
1238
- user: Partial<User> & Record<string, unknown>,
1239
- context: GenericEndpointContext | null,
1240
- ) => Promise<
1241
- | boolean
1242
- | void
1243
- | {
1244
- data: Optional<User & Record<string, any>>;
1245
- }
1246
- >;
1247
- /**
1248
- * Hook that is called after a user is updated.
1249
- */
1250
- after?: (
1251
- user: User & Record<string, unknown>,
1252
- context: GenericEndpointContext | null,
1253
- ) => Promise<void>;
1254
- };
1255
- delete?: {
1256
- /**
1257
- * Hook that is called before a user is deleted.
1258
- * if the hook returns false, the user will not be deleted.
1259
- */
1260
- before?: (
1261
- user: User & Record<string, unknown>,
1262
- context: GenericEndpointContext | null,
1263
- ) => Promise<boolean | void>;
1264
- /**
1265
- * Hook that is called after a user is deleted.
1266
- */
1267
- after?: (
1268
- user: User & Record<string, unknown>,
1269
- context: GenericEndpointContext | null,
1270
- ) => Promise<void>;
1271
- };
1272
- };
1273
- /**
1274
- * Session Hook
1275
- */
1276
- session?: {
1277
- create?: {
1278
- /**
1279
- * Hook that is called before a session is created.
1280
- * if the hook returns false, the session will not be created.
1281
- * If the hook returns an object, it'll be used instead of the original data
1282
- */
1283
- before?: (
1284
- session: Session & Record<string, unknown>,
1285
- context: GenericEndpointContext | null,
1286
- ) => Promise<
1287
- | boolean
1288
- | void
1289
- | {
1290
- data: Optional<Session> & Record<string, any>;
1291
- }
1292
- >;
1293
- /**
1294
- * Hook that is called after a session is created.
1295
- */
1296
- after?: (
1297
- session: Session & Record<string, unknown>,
1298
- context: GenericEndpointContext | null,
1299
- ) => Promise<void>;
1300
- };
1301
- /**
1302
- * Update hook
1303
- */
1304
- update?: {
1305
- /**
1306
- * Hook that is called before a user is updated.
1307
- * if the hook returns false, the session will not be updated.
1308
- * If the hook returns an object, it'll be used instead of the original data
1309
- */
1310
- before?: (
1311
- session: Partial<Session> & Record<string, unknown>,
1312
- context: GenericEndpointContext | null,
1313
- ) => Promise<
1314
- | boolean
1315
- | void
1316
- | {
1317
- data: Optional<Session & Record<string, any>>;
1318
- }
1319
- >;
1320
- /**
1321
- * Hook that is called after a session is updated.
1322
- */
1323
- after?: (
1324
- session: Session & Record<string, unknown>,
1325
- context: GenericEndpointContext | null,
1326
- ) => Promise<void>;
1327
- };
1328
- delete?: {
1329
- /**
1330
- * Hook that is called before a session is deleted.
1331
- * if the hook returns false, the session will not be deleted.
1332
- */
1333
- before?: (
1334
- session: Session & Record<string, unknown>,
1335
- context: GenericEndpointContext | null,
1336
- ) => Promise<boolean | void>;
1337
- /**
1338
- * Hook that is called after a session is deleted.
1339
- */
1340
- after?: (
1341
- session: Session & Record<string, unknown>,
1342
- context: GenericEndpointContext | null,
1343
- ) => Promise<void>;
1344
- };
1345
- };
1346
- /**
1347
- * Account Hook
1348
- */
1349
- account?: {
1350
- create?: {
1351
- /**
1352
- * Hook that is called before a account is created.
1353
- * If the hook returns false, the account will not be created.
1354
- * If the hook returns an object, it'll be used instead of the original data
1355
- */
1356
- before?: (
1357
- account: Account,
1358
- context: GenericEndpointContext | null,
1359
- ) => Promise<
1360
- | boolean
1361
- | void
1362
- | {
1363
- data: Optional<Account> & Record<string, any>;
1364
- }
1365
- >;
1366
- /**
1367
- * Hook that is called after a account is created.
1368
- */
1369
- after?: (
1370
- account: Account,
1371
- context: GenericEndpointContext | null,
1372
- ) => Promise<void>;
1373
- };
1374
- /**
1375
- * Update hook
1376
- */
1377
- update?: {
1378
- /**
1379
- * Hook that is called before a account is update.
1380
- * If the hook returns false, the user will not be updated.
1381
- * If the hook returns an object, it'll be used instead of the original data
1382
- */
1383
- before?: (
1384
- account: Partial<Account> & Record<string, unknown>,
1385
- context: GenericEndpointContext | null,
1386
- ) => Promise<
1387
- | boolean
1388
- | void
1389
- | {
1390
- data: Optional<Account & Record<string, any>>;
1391
- }
1392
- >;
1393
- /**
1394
- * Hook that is called after a account is updated.
1395
- */
1396
- after?: (
1397
- account: Account & Record<string, unknown>,
1398
- context: GenericEndpointContext | null,
1399
- ) => Promise<void>;
1400
- };
1401
- delete?: {
1402
- /**
1403
- * Hook that is called before an account is deleted.
1404
- * if the hook returns false, the account will not be deleted.
1405
- */
1406
- before?: (
1407
- account: Account & Record<string, unknown>,
1408
- context: GenericEndpointContext | null,
1409
- ) => Promise<boolean | void>;
1410
- /**
1411
- * Hook that is called after an account is deleted.
1412
- */
1413
- after?: (
1414
- account: Account & Record<string, unknown>,
1415
- context: GenericEndpointContext | null,
1416
- ) => Promise<void>;
1417
- };
1418
- };
1419
- /**
1420
- * Verification Hook
1421
- */
1422
- verification?: {
1423
- create?: {
1424
- /**
1425
- * Hook that is called before a verification is created.
1426
- * if the hook returns false, the verification will not be created.
1427
- * If the hook returns an object, it'll be used instead of the original data
1428
- */
1429
- before?: (
1430
- verification: Verification & Record<string, unknown>,
1431
- context: GenericEndpointContext | null,
1432
- ) => Promise<
1433
- | boolean
1434
- | void
1435
- | {
1436
- data: Optional<Verification> & Record<string, any>;
1437
- }
1438
- >;
1439
- /**
1440
- * Hook that is called after a verification is created.
1441
- */
1442
- after?: (
1443
- verification: Verification & Record<string, unknown>,
1444
- context: GenericEndpointContext | null,
1445
- ) => Promise<void>;
1446
- };
1447
- update?: {
1448
- /**
1449
- * Hook that is called before a verification is updated.
1450
- * if the hook returns false, the verification will not be updated.
1451
- * If the hook returns an object, it'll be used instead of the original data
1452
- */
1453
- before?: (
1454
- verification: Partial<Verification> & Record<string, unknown>,
1455
- context: GenericEndpointContext | null,
1456
- ) => Promise<
1457
- | boolean
1458
- | void
1459
- | {
1460
- data: Optional<Verification & Record<string, any>>;
1461
- }
1462
- >;
1463
- /**
1464
- * Hook that is called after a verification is updated.
1465
- */
1466
- after?: (
1467
- verification: Verification & Record<string, unknown>,
1468
- context: GenericEndpointContext | null,
1469
- ) => Promise<void>;
1470
- };
1471
- delete?: {
1472
- /**
1473
- * Hook that is called before a verification is deleted.
1474
- * if the hook returns false, the verification will not be deleted.
1475
- */
1476
- before?: (
1477
- verification: Verification & Record<string, unknown>,
1478
- context: GenericEndpointContext | null,
1479
- ) => Promise<boolean | void>;
1480
- /**
1481
- * Hook that is called after a verification is deleted.
1482
- */
1483
- after?: (
1484
- verification: Verification & Record<string, unknown>,
1485
- context: GenericEndpointContext | null,
1486
- ) => Promise<void>;
1487
- };
1488
- };
1489
- }
1490
- | undefined;
1491
- /**
1492
- * API error handling
1493
- */
1494
- onAPIError?:
1495
- | {
1496
- /**
1497
- * Throw an error on API error
1498
- *
1499
- * @default false
1500
- */
1501
- throw?: boolean;
1502
- /**
1503
- * Custom error handler
1504
- *
1505
- * @param error
1506
- * @param ctx - Auth context
1507
- */
1508
- onError?: (error: unknown, ctx: AuthContext) => void | Promise<void>;
1509
- /**
1510
- * The URL to redirect to on error
1511
- *
1512
- * When errorURL is provided, the error will be added to the URL as a query parameter
1513
- * and the user will be redirected to the errorURL.
1514
- *
1515
- * @default - "/api/auth/error"
1516
- */
1517
- errorURL?: string;
1518
- /**
1519
- * Configure the default error page provided by Better-Auth
1520
- * Start your dev server and go to /api/auth/error to see the error page.
1521
- */
1522
- customizeDefaultErrorPage?: {
1523
- colors?: {
1524
- background?: string;
1525
- foreground?: string;
1526
- primary?: string;
1527
- primaryForeground?: string;
1528
- mutedForeground?: string;
1529
- border?: string;
1530
- destructive?: string;
1531
- titleBorder?: string;
1532
- titleColor?: string;
1533
- gridColor?: string;
1534
- cardBackground?: string;
1535
- cornerBorder?: string;
1536
- };
1537
- size?: {
1538
- radiusSm?: string;
1539
- radiusMd?: string;
1540
- radiusLg?: string;
1541
- textSm?: string;
1542
- text2xl?: string;
1543
- text4xl?: string;
1544
- text6xl?: string;
1545
- };
1546
- font?: {
1547
- defaultFamily?: string;
1548
- monoFamily?: string;
1549
- };
1550
- disableTitleBorder?: boolean;
1551
- disableCornerDecorations?: boolean;
1552
- disableBackgroundGrid?: boolean;
1553
- };
1554
- }
1555
- | undefined;
1556
- /**
1557
- * Hooks
1558
- */
1559
- hooks?:
1560
- | {
1561
- /**
1562
- * Before a request is processed
1563
- */
1564
- before?: AuthMiddleware;
1565
- /**
1566
- * After a request is processed
1567
- */
1568
- after?: AuthMiddleware;
1569
- }
1570
- | undefined;
1571
- /**
1572
- * Disabled paths
1573
- *
1574
- * Paths you want to disable.
1575
- */
1576
- disabledPaths?: string[] | undefined;
1577
- /**
1578
- * Telemetry configuration
1579
- */
1580
- telemetry?:
1581
- | {
1582
- /**
1583
- * Enable telemetry collection
1584
- *
1585
- * @default false
1586
- */
1587
- enabled?: boolean;
1588
- /**
1589
- * Enable debug mode
1590
- *
1591
- * @default false
1592
- */
1593
- debug?: boolean;
1594
- }
1595
- | undefined;
1596
- /**
1597
- * Experimental features
1598
- */
1599
- experimental?: {
1600
- /**
1601
- * Enable experimental joins for your database adapter.
1602
- *
1603
- * Please read the adapter documentation for more information regarding joins before enabling this.
1604
- * Not all adapters support joins.
1605
- *
1606
- * @default false
1607
- */
1608
- joins?: boolean;
1609
- };
1610
- };