better-auth 1.7.4 → 1.7.5

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.
@@ -93,7 +93,7 @@ declare function getEndpoints<Option extends BetterAuthOptions>(ctx: Awaitable<A
93
93
  callbackURL: _$zod.ZodOptional<_$zod.ZodString>;
94
94
  newUserCallbackURL: _$zod.ZodOptional<_$zod.ZodString>;
95
95
  errorCallbackURL: _$zod.ZodOptional<_$zod.ZodString>;
96
- provider: _$zod.ZodType<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, _$zod_v4_core0.$ZodTypeInternals<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
96
+ provider: _$zod.ZodType<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, _$zod_v4_core0.$ZodTypeInternals<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
97
97
  disableRedirect: _$zod.ZodOptional<_$zod.ZodBoolean>;
98
98
  idToken: _$zod.ZodOptional<_$zod.ZodObject<{
99
99
  token: _$zod.ZodString;
@@ -121,7 +121,7 @@ declare function getEndpoints<Option extends BetterAuthOptions>(ctx: Awaitable<A
121
121
  callbackURL: _$zod.ZodOptional<_$zod.ZodString>;
122
122
  newUserCallbackURL: _$zod.ZodOptional<_$zod.ZodString>;
123
123
  errorCallbackURL: _$zod.ZodOptional<_$zod.ZodString>;
124
- provider: _$zod.ZodType<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, _$zod_v4_core0.$ZodTypeInternals<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
124
+ provider: _$zod.ZodType<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, _$zod_v4_core0.$ZodTypeInternals<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
125
125
  disableRedirect: _$zod.ZodOptional<_$zod.ZodBoolean>;
126
126
  idToken: _$zod.ZodOptional<_$zod.ZodObject<{
127
127
  token: _$zod.ZodString;
@@ -1592,7 +1592,7 @@ declare function getEndpoints<Option extends BetterAuthOptions>(ctx: Awaitable<A
1592
1592
  requireHeaders: true;
1593
1593
  body: _$zod.ZodObject<{
1594
1594
  callbackURL: _$zod.ZodOptional<_$zod.ZodString>;
1595
- provider: _$zod.ZodType<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, _$zod_v4_core0.$ZodTypeInternals<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
1595
+ provider: _$zod.ZodType<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, _$zod_v4_core0.$ZodTypeInternals<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
1596
1596
  idToken: _$zod.ZodOptional<_$zod.ZodObject<{
1597
1597
  token: _$zod.ZodString;
1598
1598
  nonce: _$zod.ZodOptional<_$zod.ZodString>;
@@ -2107,7 +2107,7 @@ declare const router: <Option extends BetterAuthOptions>(ctx: AuthContext, optio
2107
2107
  callbackURL: _$zod.ZodOptional<_$zod.ZodString>;
2108
2108
  newUserCallbackURL: _$zod.ZodOptional<_$zod.ZodString>;
2109
2109
  errorCallbackURL: _$zod.ZodOptional<_$zod.ZodString>;
2110
- provider: _$zod.ZodType<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, _$zod_v4_core0.$ZodTypeInternals<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
2110
+ provider: _$zod.ZodType<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, _$zod_v4_core0.$ZodTypeInternals<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
2111
2111
  disableRedirect: _$zod.ZodOptional<_$zod.ZodBoolean>;
2112
2112
  idToken: _$zod.ZodOptional<_$zod.ZodObject<{
2113
2113
  token: _$zod.ZodString;
@@ -2135,7 +2135,7 @@ declare const router: <Option extends BetterAuthOptions>(ctx: AuthContext, optio
2135
2135
  callbackURL: _$zod.ZodOptional<_$zod.ZodString>;
2136
2136
  newUserCallbackURL: _$zod.ZodOptional<_$zod.ZodString>;
2137
2137
  errorCallbackURL: _$zod.ZodOptional<_$zod.ZodString>;
2138
- provider: _$zod.ZodType<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, _$zod_v4_core0.$ZodTypeInternals<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
2138
+ provider: _$zod.ZodType<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, _$zod_v4_core0.$ZodTypeInternals<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
2139
2139
  disableRedirect: _$zod.ZodOptional<_$zod.ZodBoolean>;
2140
2140
  idToken: _$zod.ZodOptional<_$zod.ZodObject<{
2141
2141
  token: _$zod.ZodString;
@@ -3606,7 +3606,7 @@ declare const router: <Option extends BetterAuthOptions>(ctx: AuthContext, optio
3606
3606
  requireHeaders: true;
3607
3607
  body: _$zod.ZodObject<{
3608
3608
  callbackURL: _$zod.ZodOptional<_$zod.ZodString>;
3609
- provider: _$zod.ZodType<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, _$zod_v4_core0.$ZodTypeInternals<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
3609
+ provider: _$zod.ZodType<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, _$zod_v4_core0.$ZodTypeInternals<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
3610
3610
  idToken: _$zod.ZodOptional<_$zod.ZodObject<{
3611
3611
  token: _$zod.ZodString;
3612
3612
  nonce: _$zod.ZodOptional<_$zod.ZodString>;
@@ -92,7 +92,7 @@ declare const linkSocialAccount: _$better_call0.StrictEndpoint<"/link-social", {
92
92
  requireHeaders: true;
93
93
  body: z.ZodObject<{
94
94
  callbackURL: z.ZodOptional<z.ZodString>;
95
- provider: z.ZodType<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, z.core.$ZodTypeInternals<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
95
+ provider: z.ZodType<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, z.core.$ZodTypeInternals<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
96
96
  idToken: z.ZodOptional<z.ZodObject<{
97
97
  token: z.ZodString;
98
98
  nonce: z.ZodOptional<z.ZodString>;
@@ -8,7 +8,7 @@ declare const socialSignInBodySchema: z.ZodObject<{
8
8
  callbackURL: z.ZodOptional<z.ZodString>;
9
9
  newUserCallbackURL: z.ZodOptional<z.ZodString>;
10
10
  errorCallbackURL: z.ZodOptional<z.ZodString>;
11
- provider: z.ZodType<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, z.core.$ZodTypeInternals<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
11
+ provider: z.ZodType<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, z.core.$ZodTypeInternals<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
12
12
  disableRedirect: z.ZodOptional<z.ZodBoolean>;
13
13
  idToken: z.ZodOptional<z.ZodObject<{
14
14
  token: z.ZodString;
@@ -37,7 +37,7 @@ declare const signInSocial: <O extends BetterAuthOptions>() => _$better_call0.St
37
37
  callbackURL: z.ZodOptional<z.ZodString>;
38
38
  newUserCallbackURL: z.ZodOptional<z.ZodString>;
39
39
  errorCallbackURL: z.ZodOptional<z.ZodString>;
40
- provider: z.ZodType<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, z.core.$ZodTypeInternals<(string & {}) | "linear" | "huggingface" | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
40
+ provider: z.ZodType<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown, z.core.$ZodTypeInternals<(string & {}) | "github" | "apple" | "atlassian" | "cloudflare" | "cognito" | "discord" | "facebook" | "figma" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paybin" | "paypal" | "polar" | "railway" | "vercel" | "wechat", unknown>>;
41
41
  disableRedirect: z.ZodOptional<z.ZodBoolean>;
42
42
  idToken: z.ZodOptional<z.ZodObject<{
43
43
  token: z.ZodString;
@@ -30,17 +30,17 @@ declare const getClientConfig: (options?: BetterAuthClientOptions | undefined, l
30
30
  onResponse: ((context: _$_better_fetch_fetch0.ResponseContext) => Promise<Response | void | _$_better_fetch_fetch0.ResponseContext> | Response | _$_better_fetch_fetch0.ResponseContext | void) | undefined;
31
31
  };
32
32
  })[];
33
- priority?: RequestPriority | undefined;
34
33
  cache?: RequestCache | undefined;
35
34
  credentials?: RequestCredentials;
36
35
  integrity?: string | undefined;
37
36
  keepalive?: boolean | undefined;
38
37
  method: string;
39
38
  mode?: RequestMode | undefined;
39
+ priority?: RequestPriority | undefined;
40
40
  redirect?: RequestRedirect | undefined;
41
41
  referrer?: string | undefined;
42
42
  referrerPolicy?: ReferrerPolicy | undefined;
43
- signal?: (AbortSignal | null) | undefined;
43
+ signal?: AbortSignal | null;
44
44
  window?: null | undefined;
45
45
  onRetry?: ((response: _$_better_fetch_fetch0.ResponseContext) => Promise<void> | void) | undefined;
46
46
  hookOptions?: {
@@ -1,7 +1,7 @@
1
1
  import { Session, User } from "../types/models.mjs";
2
2
  import { CookieAttributes, HOST_COOKIE_PREFIX, SECURE_COOKIE_PREFIX, applySetCookies, cookieNameRegex, parseCookies, parseSetCookieHeader, setCookieToHeader, setRequestCookie, splitSetCookieHeader, stripSecureCookiePrefix, toCookieOptions } from "./cookie-utils.mjs";
3
3
  import { createSessionStore, getAccountCookie, getChunkedCookie, setAccountCookie } from "./session-store.mjs";
4
- import { BetterAuthCookie, BetterAuthCookies, BetterAuthOptions, CookieCachePayload, GenericEndpointContext } from "@better-auth/core";
4
+ import { Awaitable, BetterAuthCookie, BetterAuthCookies, BetterAuthOptions, CookieCachePayload, GenericEndpointContext } from "@better-auth/core";
5
5
  import * as _$better_call0 from "better-call";
6
6
  import { CookieOptions } from "better-call";
7
7
  import { JSONWebKeySet } from "jose";
@@ -106,6 +106,7 @@ declare const getSessionCookie: (request: Request | Headers, config?: {
106
106
  cookieName?: string;
107
107
  path?: string;
108
108
  } | undefined) => string | null;
109
+ type CookieCacheVersion = string | ((session: CookieCachePayload["session"], user: CookieCachePayload["user"]) => Awaitable<string>);
109
110
  declare const getCookieCache: <S extends CookieCachePayload = CookieCachePayload>(request: Request | Headers, config?: {
110
111
  cookiePrefix?: string;
111
112
  cookieName?: string;
@@ -117,7 +118,7 @@ declare const getCookieCache: <S extends CookieCachePayload = CookieCachePayload
117
118
  issuer?: string;
118
119
  audience?: string;
119
120
  } | undefined;
120
- version?: string | ((session: CookieCachePayload["session"], user: CookieCachePayload["user"]) => string) | ((session: CookieCachePayload["session"], user: CookieCachePayload["user"]) => Promise<string>);
121
+ version?: CookieCacheVersion;
121
122
  } | undefined) => Promise<S | null>;
122
123
  //#endregion
123
124
  export { CookieAttributes, EligibleCookies, HOST_COOKIE_PREFIX, SECURE_COOKIE_PREFIX, applySetCookies, cookieNameRegex, createCookieGetter, createSessionStore, decodeCookieCache, deleteSessionCookie, expireCookie, getAccountCookie, getChunkedCookie, getCookieCache, getCookies, getSessionCookie, parseCookies, parseSetCookieHeader, setAccountCookie, setCookieCache, setCookieToHeader, setRequestCookie, setSessionCookie, splitSetCookieHeader, stripSecureCookiePrefix, toCookieOptions };
@@ -268,6 +268,10 @@ const getSessionCookie = (request, config) => {
268
268
  if (sessionToken) return sessionToken;
269
269
  return null;
270
270
  };
271
+ async function matchesVersion(payload, version) {
272
+ const expectedVersion = typeof version === "string" ? version : await version(payload.session, payload.user);
273
+ return (payload.version || "1") === expectedVersion;
274
+ }
271
275
  const getCookieCache = async (request, config) => {
272
276
  const cookies = (request instanceof Headers || !("headers" in request) ? request : request.headers).get("cookie");
273
277
  if (!cookies) return null;
@@ -297,21 +301,12 @@ const getCookieCache = async (request, config) => {
297
301
  const secret = config?.secret || env.BETTER_AUTH_SECRET;
298
302
  if (!secret) throw new BetterAuthError("getCookieCache requires a secret to be provided. Either pass it as an option or set the BETTER_AUTH_SECRET environment variable");
299
303
  const payload = parseCookieCachePayload(await symmetricDecodeJWT(sessionData, secret, "better-auth-session"));
300
- if (payload) {
301
- if (config?.version) {
302
- const cookieVersion = payload.version || "1";
303
- let expectedVersion = "1";
304
- if (typeof config.version === "string") expectedVersion = config.version;
305
- else if (typeof config.version === "function") {
306
- const result = config.version(payload.session, payload.user);
307
- expectedVersion = isPromise(result) ? await result : result;
308
- }
309
- if (cookieVersion !== expectedVersion) return null;
310
- }
311
- if (isEmbeddedSessionExpired(payload.session)) return null;
312
- return payload;
304
+ if (!payload) return null;
305
+ if (config?.version) {
306
+ if (!await matchesVersion(payload, config.version)) return null;
313
307
  }
314
- return null;
308
+ if (isEmbeddedSessionExpired(payload.session)) return null;
309
+ return payload;
315
310
  } else if (strategy === "jwt") {
316
311
  const jwks = config?.jwt?.jwks;
317
312
  let payload;
@@ -324,21 +319,12 @@ const getCookieCache = async (request, config) => {
324
319
  if (!secret) throw new BetterAuthError("getCookieCache requires a secret to be provided. Either pass it as an option or set the BETTER_AUTH_SECRET environment variable");
325
320
  payload = parseCookieCachePayload(await verifyJWT(sessionData, secret));
326
321
  }
327
- if (payload) {
328
- if (config?.version) {
329
- const cookieVersion = payload.version || "1";
330
- let expectedVersion = "1";
331
- if (typeof config.version === "string") expectedVersion = config.version;
332
- else if (typeof config.version === "function") {
333
- const result = config.version(payload.session, payload.user);
334
- expectedVersion = isPromise(result) ? await result : result;
335
- }
336
- if (cookieVersion !== expectedVersion) return null;
337
- }
338
- if (isEmbeddedSessionExpired(payload.session)) return null;
339
- return payload;
322
+ if (!payload) return null;
323
+ if (config?.version) {
324
+ if (!await matchesVersion(payload, config.version)) return null;
340
325
  }
341
- return null;
326
+ if (isEmbeddedSessionExpired(payload.session)) return null;
327
+ return payload;
342
328
  } else {
343
329
  const secret = config?.secret || env.BETTER_AUTH_SECRET;
344
330
  if (!secret) throw new BetterAuthError("getCookieCache requires a secret to be provided. Either pass it as an option or set the BETTER_AUTH_SECRET environment variable");
@@ -351,14 +337,7 @@ const getCookieCache = async (request, config) => {
351
337
  const payload = parseCookieCachePayload(sessionDataPayload.session);
352
338
  if (!payload) return null;
353
339
  if (config?.version) {
354
- const cookieVersion = payload.version || "1";
355
- let expectedVersion = "1";
356
- if (typeof config.version === "string") expectedVersion = config.version;
357
- else if (typeof config.version === "function") {
358
- const result = config.version(payload.session, payload.user);
359
- expectedVersion = isPromise(result) ? await result : result;
360
- }
361
- if (cookieVersion !== expectedVersion) return null;
340
+ if (!await matchesVersion(payload, config.version)) return null;
362
341
  }
363
342
  if (typeof sessionDataPayload.expiresAt === "number" && sessionDataPayload.expiresAt < Date.now()) return null;
364
343
  if (isEmbeddedSessionExpired(payload.session)) return null;
@@ -115,10 +115,12 @@ function toDatabaseIndexMap(indexes) {
115
115
  }];
116
116
  }));
117
117
  }
118
- async function getDatabaseIndexMap(db, dbType, schemaName, tableNames, introspectIndexes) {
118
+ async function getDatabaseIndexMap(db, target, tableNames, introspectIndexes) {
119
119
  if (introspectIndexes) return toDatabaseIndexMap(await introspectIndexes(tableNames));
120
120
  let rows;
121
- if (dbType === "sqlite") rows = (await sql`
121
+ switch (target.type) {
122
+ case "sqlite":
123
+ rows = (await sql`
122
124
  SELECT
123
125
  tables.name AS "tableName",
124
126
  index_list.name AS "indexName",
@@ -131,7 +133,9 @@ async function getDatabaseIndexMap(db, dbType, schemaName, tableNames, introspec
131
133
  INNER JOIN pragma_index_info(index_list.name) AS index_info
132
134
  WHERE tables.type = 'table'
133
135
  `.execute(db)).rows;
134
- else if (dbType === "postgres") rows = (await sql`
136
+ break;
137
+ case "postgres":
138
+ rows = (await sql`
135
139
  SELECT
136
140
  table_class.relname AS "tableName",
137
141
  index_class.relname AS "indexName",
@@ -153,11 +157,13 @@ async function getDatabaseIndexMap(db, dbType, schemaName, tableNames, introspec
153
157
  LEFT JOIN pg_attribute AS index_attribute
154
158
  ON index_attribute.attrelid = table_class.oid
155
159
  AND index_attribute.attnum = index_column.attribute_number
156
- WHERE table_namespace.nspname = ${schemaName}
160
+ WHERE table_namespace.nspname = ${target.schema}
157
161
  AND table_class.relkind = 'r'
158
162
  AND index_column.ordinality <= index_data.indnkeyatts
159
163
  `.execute(db)).rows;
160
- else if (dbType === "mysql") rows = (await sql`
164
+ break;
165
+ case "mysql":
166
+ rows = (await sql`
161
167
  SELECT
162
168
  table_name AS tableName,
163
169
  index_name AS indexName,
@@ -169,7 +175,9 @@ async function getDatabaseIndexMap(db, dbType, schemaName, tableNames, introspec
169
175
  FROM information_schema.statistics
170
176
  WHERE table_schema = DATABASE()
171
177
  `.execute(db)).rows;
172
- else rows = (await sql`
178
+ break;
179
+ case "mssql":
180
+ rows = (await sql`
173
181
  SELECT
174
182
  tables.name AS "tableName",
175
183
  indexes.name AS "indexName",
@@ -190,10 +198,12 @@ async function getDatabaseIndexMap(db, dbType, schemaName, tableNames, introspec
190
198
  INNER JOIN sys.columns AS columns
191
199
  ON columns.object_id = index_columns.object_id
192
200
  AND columns.column_id = index_columns.column_id
193
- WHERE table_schemas.name = ${schemaName}
201
+ WHERE table_schemas.name = ${target.schema}
194
202
  AND indexes.name IS NOT NULL
195
203
  AND index_columns.key_ordinal > 0
196
204
  `.execute(db)).rows;
205
+ break;
206
+ }
197
207
  const indexMetadata = /* @__PURE__ */ new Map();
198
208
  for (const row of rows) {
199
209
  const table = row.tableName ?? row.table_name ?? row.TABLE_NAME ?? row.tablename ?? row.tbl_name;
@@ -228,46 +238,45 @@ async function getDatabaseIndexMap(db, dbType, schemaName, tableNames, introspec
228
238
  }
229
239
  return toDatabaseIndexMap([...indexMetadata.values()]);
230
240
  }
231
- async function getDatabaseColumnBounds(db, dbType, schemaName) {
232
- if (dbType !== "mysql" && dbType !== "mssql") return /* @__PURE__ */ new Map();
241
+ async function getDatabaseColumnBounds(db, target) {
233
242
  let rows;
234
- if (dbType === "mysql") rows = (await sql`
243
+ switch (target.type) {
244
+ case "postgres":
245
+ case "sqlite": return /* @__PURE__ */ new Map();
246
+ case "mysql":
247
+ rows = (await sql`
235
248
  SELECT
236
249
  table_name AS tableName,
237
250
  column_name AS columnName,
238
- data_type AS dataType,
239
- character_maximum_length AS characterMaximumLength
251
+ character_octet_length AS maxIndexBytes
240
252
  FROM information_schema.columns
241
253
  WHERE table_schema = DATABASE()
242
254
  `.execute(db)).rows;
243
- else rows = (await sql`
255
+ break;
256
+ case "mssql":
257
+ rows = (await sql`
244
258
  SELECT
245
259
  tables.name AS "tableName",
246
260
  columns.name AS "columnName",
247
- types.name AS "dataType",
248
- columns.max_length AS "maxLength"
261
+ columns.max_length AS "maxIndexBytes"
249
262
  FROM sys.columns AS columns
250
263
  INNER JOIN sys.tables AS tables
251
264
  ON tables.object_id = columns.object_id
252
265
  INNER JOIN sys.schemas AS table_schemas
253
266
  ON table_schemas.schema_id = tables.schema_id
254
- INNER JOIN sys.types AS types
255
- ON types.user_type_id = columns.user_type_id
256
- WHERE table_schemas.name = ${schemaName}
267
+ WHERE table_schemas.name = ${target.schema}
257
268
  `.execute(db)).rows;
258
- return new Map(rows.flatMap((row) => {
269
+ break;
270
+ }
271
+ const bounds = /* @__PURE__ */ new Map();
272
+ for (const row of rows) {
259
273
  const table = row.tableName ?? row.TABLE_NAME;
260
274
  const column = row.columnName ?? row.COLUMN_NAME;
261
- const dataType = (row.dataType ?? row.DATA_TYPE)?.toLowerCase();
262
- if (!table || !column || !dataType) return [];
263
- if (dbType === "mysql") {
264
- const characterLength = row.characterMaximumLength ?? row.CHARACTER_MAXIMUM_LENGTH;
265
- const maxIndexBytes = characterLength === null || characterLength === void 0 ? null : Number(characterLength) * 4;
266
- return [[createDatabaseColumnKey(table, column), { maxIndexBytes }]];
267
- }
268
- const maxLength = Number(row.maxLength ?? -1);
269
- return [[createDatabaseColumnKey(table, column), { maxIndexBytes: maxLength < 0 ? null : maxLength }]];
270
- }));
275
+ if (!table || !column) continue;
276
+ const maxIndexBytes = Number(row.maxIndexBytes ?? row.MAX_INDEX_BYTES ?? -1);
277
+ bounds.set(createDatabaseColumnKey(table, column), { maxIndexBytes: maxIndexBytes < 0 ? null : maxIndexBytes });
278
+ }
279
+ return bounds;
271
280
  }
272
281
  function assertExistingTableIndexFits({ columnBounds, dbType, existingColumns, fields, indexes, index, table }) {
273
282
  const byteBudget = dbType === "mysql" ? 3072 : 1700;
@@ -341,7 +350,7 @@ async function getMigrations(config, { throwOnUnsafe = true } = {}) {
341
350
  if (throwOnUnsafe) throw new UnsafeMigrationError(message);
342
351
  unsafeChanges.push(message);
343
352
  };
344
- let { kysely: db, databaseType: dbType, introspectIndexes } = await createKyselyAdapter(config);
353
+ let { kysely: db, databaseType: dbType, introspectIndexes, schemaName } = await createKyselyAdapter(config);
345
354
  if (!dbType) {
346
355
  logger.warn("Could not determine database type, defaulting to sqlite. Please provide a type in the database options to avoid this.");
347
356
  dbType = "sqlite";
@@ -350,39 +359,50 @@ async function getMigrations(config, { throwOnUnsafe = true } = {}) {
350
359
  logger.error("Only kysely adapter is supported for migrations. You can use `generate` command to generate the schema, if you're using a different adapter.");
351
360
  process.exit(1);
352
361
  }
353
- let currentSchema = dbType === "mssql" ? await getMssqlSchema(db) : "public";
354
- if (dbType === "postgres") {
355
- currentSchema = await getPostgresSchema(db);
356
- logger.debug(`PostgreSQL migration: Using schema '${currentSchema}' (from search_path)`);
357
- try {
358
- const schemaCheck = await sql`
359
- SELECT schema_name
360
- FROM information_schema.schemata
361
- WHERE schema_name = ${currentSchema}
362
- `.execute(db);
363
- if (!(schemaCheck.rows[0]?.schema_name ?? schemaCheck.rows[0]?.schemaName)) logger.warn(`Schema '${currentSchema}' does not exist. Tables will be inspected from available schemas. Consider creating the schema first or checking your database configuration.`);
364
- } catch (error) {
365
- logger.debug(`Could not verify schema existence: ${error instanceof Error ? error.message : String(error)}`);
366
- }
367
- } else if (dbType === "mssql") logger.debug(`SQL Server migration: Using schema '${currentSchema}' (from the current user's default schema)`);
368
362
  const allTableMetadata = await db.introspection.getTables();
369
- const databaseIndexMap = await getDatabaseIndexMap(db, dbType, currentSchema, allTableMetadata.map((table) => table.name), introspectIndexes);
370
- const databaseColumnBounds = await getDatabaseColumnBounds(db, dbType, currentSchema);
363
+ let target;
371
364
  let tableMetadata = allTableMetadata;
372
- if (dbType === "postgres") try {
373
- const tablesInSchema = await sql`
374
- SELECT table_name
375
- FROM information_schema.tables
376
- WHERE table_schema = ${currentSchema}
377
- AND table_type = 'BASE TABLE'
378
- `.execute(db);
379
- const tableNamesInSchema = new Set(tablesInSchema.rows.map((row) => row.table_name ?? row.tableName));
380
- tableMetadata = allTableMetadata.filter((table) => table.schema === currentSchema && tableNamesInSchema.has(table.name));
381
- logger.debug(`Found ${tableMetadata.length} table(s) in schema '${currentSchema}': ${tableMetadata.map((t) => t.name).join(", ") || "(none)"}`);
382
- } catch (error) {
383
- logger.warn(`Could not filter tables by schema. Using all discovered tables. Error: ${error instanceof Error ? error.message : String(error)}`);
365
+ switch (dbType) {
366
+ case "postgres": {
367
+ const schema = schemaName ?? await getPostgresSchema(db);
368
+ target = {
369
+ type: "postgres",
370
+ schema
371
+ };
372
+ logger.debug(`PostgreSQL migration: Using schema '${schema}' (${schemaName ? "from database.schemaName" : "from search_path"})`);
373
+ try {
374
+ if (!(await db.introspection.getSchemas()).some(({ name }) => name === schema)) if (schemaName) logger.debug(`Schema '${schema}' does not exist yet. The migration creates it before creating tables.`);
375
+ else logger.warn(`Schema '${schema}' does not exist. Create it before running migrations or check your database configuration.`);
376
+ } catch (error) {
377
+ logger.debug(`Could not verify schema existence: ${error instanceof Error ? error.message : String(error)}`);
378
+ }
379
+ /**
380
+ * Kysely 0.28 does not expose `isForeign`, while 0.29 adds foreign table metadata.
381
+ * @see https://github.com/kysely-org/kysely/pull/1494
382
+ */
383
+ tableMetadata = allTableMetadata.filter((table) => table.schema === schema && !table.isView && !("isForeign" in table && table.isForeign));
384
+ logger.debug(`Found ${tableMetadata.length} table(s) in schema '${schema}': ${tableMetadata.map((table) => table.name).join(", ") || "(none)"}`);
385
+ break;
386
+ }
387
+ case "mssql": {
388
+ const schema = await getMssqlSchema(db);
389
+ target = {
390
+ type: "mssql",
391
+ schema
392
+ };
393
+ logger.debug(`SQL Server migration: Using schema '${schema}' (from the current user's default schema)`);
394
+ tableMetadata = allTableMetadata.filter((table) => table.schema === schema);
395
+ break;
396
+ }
397
+ case "mysql":
398
+ target = { type: "mysql" };
399
+ break;
400
+ case "sqlite":
401
+ target = { type: "sqlite" };
402
+ break;
384
403
  }
385
- else if (dbType === "mssql") tableMetadata = allTableMetadata.filter((table) => table.schema === currentSchema);
404
+ const databaseIndexMap = await getDatabaseIndexMap(db, target, allTableMetadata.map((table) => table.name), introspectIndexes);
405
+ const databaseColumnBounds = await getDatabaseColumnBounds(db, target);
386
406
  const schemaProblems = diffSchema(toPhysicalSchema(db, betterAuthSchema), toIntrospectedTables(tableMetadata)).filter((finding) => finding.kind === "unexpected-required-column").map((finding) => formatSchemaFinding(finding, "database"));
387
407
  const toBeCreated = [];
388
408
  const toBeAdded = [];
@@ -464,6 +484,7 @@ async function getMigrations(config, { throwOnUnsafe = true } = {}) {
464
484
  });
465
485
  }
466
486
  const migrations = [];
487
+ if (schemaName && toBeCreated.length > 0) migrations.push(db.schema.createSchema(schemaName).ifNotExists());
467
488
  const useUUIDs = config.advanced?.database?.generateId === "uuid";
468
489
  const useNumberId = config.advanced?.database?.generateId === "serial";
469
490
  function getType(field, fieldName, tableIndexStringLength) {
package/dist/package.mjs CHANGED
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "1.7.4";
2
+ var version = "1.7.5";
3
3
  //#endregion
4
4
  export { version };
@@ -297,13 +297,13 @@ declare const admin: <O extends AdminOptions>(options?: O | undefined) => {
297
297
  filterField: _$zod.ZodOptional<_$zod.ZodString>;
298
298
  filterValue: _$zod.ZodOptional<_$zod.ZodUnion<[_$zod.ZodUnion<[_$zod.ZodUnion<[_$zod.ZodUnion<[_$zod.ZodString, _$zod.ZodNumber]>, _$zod.ZodBoolean]>, _$zod.ZodArray<_$zod.ZodString>]>, _$zod.ZodArray<_$zod.ZodNumber>]>>;
299
299
  filterOperator: _$zod.ZodOptional<_$zod.ZodEnum<{
300
+ in: "in";
301
+ lte: "lte";
300
302
  eq: "eq";
301
303
  ne: "ne";
304
+ lt: "lt";
302
305
  gt: "gt";
303
306
  gte: "gte";
304
- lt: "lt";
305
- lte: "lte";
306
- in: "in";
307
307
  not_in: "not_in";
308
308
  contains: "contains";
309
309
  starts_with: "starts_with";
@@ -42,6 +42,7 @@ const captcha = (options) => ({
42
42
  };
43
43
  if (options.provider === Providers.CLOUDFLARE_TURNSTILE) return await cloudflareTurnstile({
44
44
  ...handlerParams,
45
+ logger: ctx.logger,
45
46
  expectedAction: options.expectedAction,
46
47
  allowedHostnames: options.allowedHostnames
47
48
  });
@@ -3,7 +3,7 @@ import { CAPTCHA_VERIFY_TIMEOUT_MS } from "../constants.mjs";
3
3
  import { EXTERNAL_ERROR_CODES, INTERNAL_ERROR_CODES } from "../error-codes.mjs";
4
4
  import { betterFetch } from "@better-fetch/fetch";
5
5
  //#region src/plugins/captcha/verify-handlers/cloudflare-turnstile.ts
6
- const cloudflareTurnstile = async ({ siteVerifyURL, captchaResponse, secretKey, remoteIP, expectedAction, allowedHostnames }) => {
6
+ const cloudflareTurnstile = async ({ siteVerifyURL, captchaResponse, secretKey, logger, remoteIP, expectedAction, allowedHostnames }) => {
7
7
  const response = await betterFetch(siteVerifyURL, {
8
8
  method: "POST",
9
9
  timeout: CAPTCHA_VERIFY_TIMEOUT_MS,
@@ -15,14 +15,33 @@ const cloudflareTurnstile = async ({ siteVerifyURL, captchaResponse, secretKey,
15
15
  })
16
16
  });
17
17
  if (!response.data || response.error) throw new Error(INTERNAL_ERROR_CODES.SERVICE_UNAVAILABLE.message);
18
- const verificationFailed = () => middlewareResponse({
19
- message: EXTERNAL_ERROR_CODES.VERIFICATION_FAILED.message,
20
- code: EXTERNAL_ERROR_CODES.VERIFICATION_FAILED.code,
21
- status: 403
18
+ const verificationFailed = (details) => {
19
+ logger.warn("Cloudflare Turnstile verification failed", {
20
+ provider: "cloudflare-turnstile",
21
+ ...details
22
+ });
23
+ return middlewareResponse({
24
+ message: EXTERNAL_ERROR_CODES.VERIFICATION_FAILED.message,
25
+ code: EXTERNAL_ERROR_CODES.VERIFICATION_FAILED.code,
26
+ status: 403
27
+ });
28
+ };
29
+ if (!response.data.success) return verificationFailed({
30
+ reason: "siteverify_rejected",
31
+ errorCodes: response.data["error-codes"] ?? [],
32
+ ...response.data.hostname && { hostname: response.data.hostname },
33
+ ...response.data.action && { action: response.data.action }
34
+ });
35
+ if (expectedAction && response.data.action !== expectedAction) return verificationFailed({
36
+ reason: "action_mismatch",
37
+ expectedAction,
38
+ actualAction: response.data.action
39
+ });
40
+ if (allowedHostnames && allowedHostnames.length > 0 && !(response.data.hostname && allowedHostnames.includes(response.data.hostname))) return verificationFailed({
41
+ reason: "hostname_mismatch",
42
+ allowedHostnames,
43
+ actualHostname: response.data.hostname
22
44
  });
23
- if (!response.data.success) return verificationFailed();
24
- if (expectedAction && response.data.action !== expectedAction) return verificationFailed();
25
- if (allowedHostnames && allowedHostnames.length > 0 && !(response.data.hostname && allowedHostnames.includes(response.data.hostname))) return verificationFailed();
26
45
  };
27
46
  //#endregion
28
47
  export { cloudflareTurnstile };
@@ -736,13 +736,13 @@ declare const listMembers: <O extends OrganizationOptions>(options: O) => _$bett
736
736
  filterField: z.ZodOptional<z.ZodString>;
737
737
  filterValue: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodBoolean]>, z.ZodArray<z.ZodString>]>, z.ZodArray<z.ZodNumber>]>>;
738
738
  filterOperator: z.ZodOptional<z.ZodEnum<{
739
+ in: "in";
740
+ lte: "lte";
739
741
  eq: "eq";
740
742
  ne: "ne";
743
+ lt: "lt";
741
744
  gt: "gt";
742
745
  gte: "gte";
743
- lt: "lt";
744
- lte: "lte";
745
- in: "in";
746
746
  not_in: "not_in";
747
747
  contains: "contains";
748
748
  starts_with: "starts_with";
@@ -244,10 +244,10 @@ type OrganizationSchema<O extends OrganizationOptions> = (O["dynamicAccessContro
244
244
  };
245
245
  declare const roleSchema: z.ZodString;
246
246
  declare const invitationStatus: z.ZodDefault<z.ZodEnum<{
247
- canceled: "canceled";
248
247
  pending: "pending";
249
248
  accepted: "accepted";
250
249
  rejected: "rejected";
250
+ canceled: "canceled";
251
251
  }>>;
252
252
  declare const organizationSchema: z.ZodObject<{
253
253
  id: z.ZodDefault<z.ZodString>;
@@ -270,10 +270,10 @@ declare const invitationSchema: z.ZodObject<{
270
270
  email: z.ZodString;
271
271
  role: z.ZodString;
272
272
  status: z.ZodDefault<z.ZodEnum<{
273
- canceled: "canceled";
274
273
  pending: "pending";
275
274
  accepted: "accepted";
276
275
  rejected: "rejected";
276
+ canceled: "canceled";
277
277
  }>>;
278
278
  teamId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
279
279
  inviterId: z.ZodString;
@@ -266,14 +266,14 @@ declare const usernameImpl: <IncludeDisplayUsername extends boolean>(options: Us
266
266
  unique: true;
267
267
  returned: true;
268
268
  transform: {
269
- input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
269
+ input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
270
270
  };
271
271
  };
272
272
  displayUsername: {
273
273
  type: "string";
274
274
  required: false;
275
275
  transform: {
276
- input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
276
+ input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
277
277
  };
278
278
  };
279
279
  }, "username"> : {
@@ -284,14 +284,14 @@ declare const usernameImpl: <IncludeDisplayUsername extends boolean>(options: Us
284
284
  unique: true;
285
285
  returned: true;
286
286
  transform: {
287
- input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
287
+ input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
288
288
  };
289
289
  };
290
290
  displayUsername: {
291
291
  type: "string";
292
292
  required: false;
293
293
  transform: {
294
- input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
294
+ input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
295
295
  };
296
296
  };
297
297
  };
@@ -14,14 +14,14 @@ declare const getSchema: <IncludeDisplayUsername extends boolean = true>(normali
14
14
  unique: true;
15
15
  returned: true;
16
16
  transform: {
17
- input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
17
+ input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
18
18
  };
19
19
  };
20
20
  displayUsername: {
21
21
  type: "string";
22
22
  required: false;
23
23
  transform: {
24
- input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
24
+ input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
25
25
  };
26
26
  };
27
27
  }, "username"> : {
@@ -32,14 +32,14 @@ declare const getSchema: <IncludeDisplayUsername extends boolean = true>(normali
32
32
  unique: true;
33
33
  returned: true;
34
34
  transform: {
35
- input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
35
+ input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
36
36
  };
37
37
  };
38
38
  displayUsername: {
39
39
  type: "string";
40
40
  required: false;
41
41
  transform: {
42
- input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | Record<string, unknown> | unknown[] | null | undefined;
42
+ input(value: _$_better_auth_core_db0.DBPrimitive): string | number | boolean | Date | unknown[] | Record<string, unknown> | null | undefined;
43
43
  };
44
44
  };
45
45
  };
@@ -88,17 +88,17 @@ declare function getHttpTestInstance<O extends Partial<BetterAuthOptions>, C ext
88
88
  onResponse: ((context: _$_better_fetch_fetch0.ResponseContext) => Promise<Response | void | _$_better_fetch_fetch0.ResponseContext> | Response | _$_better_fetch_fetch0.ResponseContext | void) | undefined;
89
89
  };
90
90
  })[];
91
- priority?: RequestPriority | undefined;
92
91
  cache?: RequestCache | undefined;
93
92
  credentials?: RequestCredentials;
94
93
  integrity?: string | undefined;
95
94
  keepalive?: boolean | undefined;
96
95
  method: string;
97
96
  mode?: RequestMode | undefined;
97
+ priority?: RequestPriority | undefined;
98
98
  redirect?: RequestRedirect | undefined;
99
99
  referrer?: string | undefined;
100
100
  referrerPolicy?: ReferrerPolicy | undefined;
101
- signal?: (AbortSignal | null) | undefined;
101
+ signal?: AbortSignal | null;
102
102
  window?: null | undefined;
103
103
  onRetry?: ((response: _$_better_fetch_fetch0.ResponseContext) => Promise<void> | void) | undefined;
104
104
  hookOptions?: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-auth",
3
- "version": "1.7.4",
3
+ "version": "1.7.5",
4
4
  "description": "The most comprehensive authentication framework for TypeScript.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -464,7 +464,7 @@
464
464
  },
465
465
  "dependencies": {
466
466
  "@better-auth/utils": "0.4.2",
467
- "@better-fetch/fetch": "1.3.1",
467
+ "@better-fetch/fetch": "1.3.2",
468
468
  "@noble/ciphers": "^2.2.0",
469
469
  "@noble/hashes": "^2.2.0",
470
470
  "better-call": "1.4.0",
@@ -473,13 +473,13 @@
473
473
  "kysely": "^0.28.17 || ^0.29.0",
474
474
  "nanostores": "^1.3.0",
475
475
  "zod": "^4.5.4",
476
- "@better-auth/core": "1.7.4",
477
- "@better-auth/drizzle-adapter": "1.7.4",
478
- "@better-auth/kysely-adapter": "1.7.4",
479
- "@better-auth/memory-adapter": "1.7.4",
480
- "@better-auth/mongo-adapter": "1.7.4",
481
- "@better-auth/prisma-adapter": "1.7.4",
482
- "@better-auth/telemetry": "1.7.4"
476
+ "@better-auth/core": "1.7.5",
477
+ "@better-auth/drizzle-adapter": "1.7.5",
478
+ "@better-auth/kysely-adapter": "1.7.5",
479
+ "@better-auth/memory-adapter": "1.7.5",
480
+ "@better-auth/mongo-adapter": "1.7.5",
481
+ "@better-auth/prisma-adapter": "1.7.5",
482
+ "@better-auth/telemetry": "1.7.5"
483
483
  },
484
484
  "devDependencies": {
485
485
  "@lynx-js/react": "^0.121.2",
@@ -513,7 +513,6 @@
513
513
  "@sveltejs/kit": "^2.0.0",
514
514
  "@tanstack/react-start": "^1.0.0",
515
515
  "@tanstack/solid-start": "^1.0.0",
516
- "better-sqlite3": "^12.0.0",
517
516
  "drizzle-kit": ">=0.31.4 || >=1.0.0-beta.1",
518
517
  "drizzle-orm": "^0.45.2 || >=1.0.0-rc.1 <2.0.0",
519
518
  "mongodb": "^6.0.0 || ^7.0.0",
@@ -580,9 +579,6 @@
580
579
  "prisma": {
581
580
  "optional": true
582
581
  },
583
- "better-sqlite3": {
584
- "optional": true
585
- },
586
582
  "vitest": {
587
583
  "optional": true
588
584
  }