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