better-auth 1.6.12 → 1.6.14

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 (39) hide show
  1. package/dist/api/index.d.mts +4 -46
  2. package/dist/api/routes/account.d.mts +2 -23
  3. package/dist/api/routes/account.mjs +94 -73
  4. package/dist/api/routes/callback.mjs +3 -2
  5. package/dist/api/routes/password.mjs +1 -1
  6. package/dist/api/routes/session.mjs +1 -1
  7. package/dist/api/routes/sign-in.mjs +1 -1
  8. package/dist/api/routes/update-user.mjs +3 -3
  9. package/dist/client/fetch-plugins.mjs +2 -1
  10. package/dist/context/create-context.mjs +10 -14
  11. package/dist/cookies/index.mjs +1 -1
  12. package/dist/db/internal-adapter.mjs +19 -20
  13. package/dist/db/to-zod.d.mts +2 -2
  14. package/dist/db/to-zod.mjs +1 -1
  15. package/dist/oauth2/index.d.mts +2 -2
  16. package/dist/oauth2/index.mjs +3 -3
  17. package/dist/oauth2/link-account.d.mts +27 -1
  18. package/dist/oauth2/link-account.mjs +24 -1
  19. package/dist/package.mjs +1 -1
  20. package/dist/plugins/admin/routes.mjs +3 -3
  21. package/dist/plugins/anonymous/index.mjs +2 -2
  22. package/dist/plugins/email-otp/routes.mjs +1 -1
  23. package/dist/plugins/generic-oauth/routes.mjs +3 -2
  24. package/dist/plugins/mcp/index.mjs +2 -1
  25. package/dist/plugins/oauth-proxy/index.mjs +1 -1
  26. package/dist/plugins/oidc-provider/index.mjs +2 -1
  27. package/dist/plugins/one-tap/client.mjs +9 -2
  28. package/dist/plugins/one-tap/index.mjs +16 -39
  29. package/dist/plugins/organization/adapter.mjs +2 -0
  30. package/dist/plugins/organization/routes/crud-access-control.d.mts +1 -1
  31. package/dist/plugins/organization/routes/crud-invites.mjs +30 -4
  32. package/dist/plugins/organization/routes/crud-org.d.mts +4 -4
  33. package/dist/plugins/organization/routes/crud-org.mjs +2 -2
  34. package/dist/plugins/organization/types.d.mts +21 -14
  35. package/dist/plugins/phone-number/routes.mjs +1 -1
  36. package/dist/plugins/two-factor/backup-codes/index.d.mts +4 -3
  37. package/dist/plugins/two-factor/client.mjs +2 -1
  38. package/dist/test-utils/test-instance.d.mts +12 -138
  39. package/package.json +8 -8
@@ -1943,29 +1943,6 @@ declare function getTestInstance<O extends Partial<BetterAuthOptions>, C extends
1943
1943
  }>;
1944
1944
  readonly accountInfo: better_call0.StrictEndpoint<"/account-info", {
1945
1945
  method: "GET";
1946
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
1947
- session: {
1948
- session: Record<string, any> & {
1949
- id: string;
1950
- createdAt: Date;
1951
- updatedAt: Date;
1952
- userId: string;
1953
- expiresAt: Date;
1954
- token: string;
1955
- ipAddress?: string | null | undefined;
1956
- userAgent?: string | null | undefined;
1957
- };
1958
- user: Record<string, any> & {
1959
- id: string;
1960
- createdAt: Date;
1961
- updatedAt: Date;
1962
- email: string;
1963
- emailVerified: boolean;
1964
- name: string;
1965
- image?: string | null | undefined;
1966
- };
1967
- };
1968
- }>)[];
1969
1946
  metadata: {
1970
1947
  openapi: {
1971
1948
  description: string;
@@ -2015,6 +1992,8 @@ declare function getTestInstance<O extends Partial<BetterAuthOptions>, C extends
2015
1992
  };
2016
1993
  query: zod.ZodOptional<zod.ZodObject<{
2017
1994
  accountId: zod.ZodOptional<zod.ZodString>;
1995
+ providerId: zod.ZodOptional<zod.ZodString>;
1996
+ userId: zod.ZodOptional<zod.ZodString>;
2018
1997
  }, zod_v4_core0.$strip>>;
2019
1998
  }, {
2020
1999
  user: _better_auth_core_oauth20.OAuth2UserInfo;
@@ -3948,29 +3927,6 @@ declare function getTestInstance<O extends Partial<BetterAuthOptions>, C extends
3948
3927
  }>;
3949
3928
  readonly accountInfo: better_call0.StrictEndpoint<"/account-info", {
3950
3929
  method: "GET";
3951
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
3952
- session: {
3953
- session: Record<string, any> & {
3954
- id: string;
3955
- createdAt: Date;
3956
- updatedAt: Date;
3957
- userId: string;
3958
- expiresAt: Date;
3959
- token: string;
3960
- ipAddress?: string | null | undefined;
3961
- userAgent?: string | null | undefined;
3962
- };
3963
- user: Record<string, any> & {
3964
- id: string;
3965
- createdAt: Date;
3966
- updatedAt: Date;
3967
- email: string;
3968
- emailVerified: boolean;
3969
- name: string;
3970
- image?: string | null | undefined;
3971
- };
3972
- };
3973
- }>)[];
3974
3930
  metadata: {
3975
3931
  openapi: {
3976
3932
  description: string;
@@ -4020,6 +3976,8 @@ declare function getTestInstance<O extends Partial<BetterAuthOptions>, C extends
4020
3976
  };
4021
3977
  query: zod.ZodOptional<zod.ZodObject<{
4022
3978
  accountId: zod.ZodOptional<zod.ZodString>;
3979
+ providerId: zod.ZodOptional<zod.ZodString>;
3980
+ userId: zod.ZodOptional<zod.ZodString>;
4023
3981
  }, zod_v4_core0.$strip>>;
4024
3982
  }, {
4025
3983
  user: _better_auth_core_oauth20.OAuth2UserInfo;
@@ -5956,29 +5914,6 @@ declare function getTestInstance<O extends Partial<BetterAuthOptions>, C extends
5956
5914
  }>;
5957
5915
  readonly accountInfo: better_call0.StrictEndpoint<"/account-info", {
5958
5916
  method: "GET";
5959
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
5960
- session: {
5961
- session: Record<string, any> & {
5962
- id: string;
5963
- createdAt: Date;
5964
- updatedAt: Date;
5965
- userId: string;
5966
- expiresAt: Date;
5967
- token: string;
5968
- ipAddress?: string | null | undefined;
5969
- userAgent?: string | null | undefined;
5970
- };
5971
- user: Record<string, any> & {
5972
- id: string;
5973
- createdAt: Date;
5974
- updatedAt: Date;
5975
- email: string;
5976
- emailVerified: boolean;
5977
- name: string;
5978
- image?: string | null | undefined;
5979
- };
5980
- };
5981
- }>)[];
5982
5917
  metadata: {
5983
5918
  openapi: {
5984
5919
  description: string;
@@ -6028,6 +5963,8 @@ declare function getTestInstance<O extends Partial<BetterAuthOptions>, C extends
6028
5963
  };
6029
5964
  query: zod.ZodOptional<zod.ZodObject<{
6030
5965
  accountId: zod.ZodOptional<zod.ZodString>;
5966
+ providerId: zod.ZodOptional<zod.ZodString>;
5967
+ userId: zod.ZodOptional<zod.ZodString>;
6031
5968
  }, zod_v4_core0.$strip>>;
6032
5969
  }, {
6033
5970
  user: _better_auth_core_oauth20.OAuth2UserInfo;
@@ -7961,29 +7898,6 @@ declare function getTestInstance<O extends Partial<BetterAuthOptions>, C extends
7961
7898
  }>;
7962
7899
  readonly accountInfo: better_call0.StrictEndpoint<"/account-info", {
7963
7900
  method: "GET";
7964
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
7965
- session: {
7966
- session: Record<string, any> & {
7967
- id: string;
7968
- createdAt: Date;
7969
- updatedAt: Date;
7970
- userId: string;
7971
- expiresAt: Date;
7972
- token: string;
7973
- ipAddress?: string | null | undefined;
7974
- userAgent?: string | null | undefined;
7975
- };
7976
- user: Record<string, any> & {
7977
- id: string;
7978
- createdAt: Date;
7979
- updatedAt: Date;
7980
- email: string;
7981
- emailVerified: boolean;
7982
- name: string;
7983
- image?: string | null | undefined;
7984
- };
7985
- };
7986
- }>)[];
7987
7901
  metadata: {
7988
7902
  openapi: {
7989
7903
  description: string;
@@ -8033,6 +7947,8 @@ declare function getTestInstance<O extends Partial<BetterAuthOptions>, C extends
8033
7947
  };
8034
7948
  query: zod.ZodOptional<zod.ZodObject<{
8035
7949
  accountId: zod.ZodOptional<zod.ZodString>;
7950
+ providerId: zod.ZodOptional<zod.ZodString>;
7951
+ userId: zod.ZodOptional<zod.ZodString>;
8036
7952
  }, zod_v4_core0.$strip>>;
8037
7953
  }, {
8038
7954
  user: _better_auth_core_oauth20.OAuth2UserInfo;
@@ -10040,29 +9956,6 @@ declare function getTestInstance<O extends Partial<BetterAuthOptions>, C extends
10040
9956
  }>;
10041
9957
  readonly accountInfo: better_call0.StrictEndpoint<"/account-info", {
10042
9958
  method: "GET";
10043
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
10044
- session: {
10045
- session: Record<string, any> & {
10046
- id: string;
10047
- createdAt: Date;
10048
- updatedAt: Date;
10049
- userId: string;
10050
- expiresAt: Date;
10051
- token: string;
10052
- ipAddress?: string | null | undefined;
10053
- userAgent?: string | null | undefined;
10054
- };
10055
- user: Record<string, any> & {
10056
- id: string;
10057
- createdAt: Date;
10058
- updatedAt: Date;
10059
- email: string;
10060
- emailVerified: boolean;
10061
- name: string;
10062
- image?: string | null | undefined;
10063
- };
10064
- };
10065
- }>)[];
10066
9959
  metadata: {
10067
9960
  openapi: {
10068
9961
  description: string;
@@ -10112,6 +10005,8 @@ declare function getTestInstance<O extends Partial<BetterAuthOptions>, C extends
10112
10005
  };
10113
10006
  query: zod.ZodOptional<zod.ZodObject<{
10114
10007
  accountId: zod.ZodOptional<zod.ZodString>;
10008
+ providerId: zod.ZodOptional<zod.ZodString>;
10009
+ userId: zod.ZodOptional<zod.ZodString>;
10115
10010
  }, zod_v4_core0.$strip>>;
10116
10011
  }, {
10117
10012
  user: _better_auth_core_oauth20.OAuth2UserInfo;
@@ -12045,29 +11940,6 @@ declare function getTestInstance<O extends Partial<BetterAuthOptions>, C extends
12045
11940
  }>;
12046
11941
  readonly accountInfo: better_call0.StrictEndpoint<"/account-info", {
12047
11942
  method: "GET";
12048
- use: ((inputContext: better_call0.MiddlewareInputContext<better_call0.MiddlewareOptions>) => Promise<{
12049
- session: {
12050
- session: Record<string, any> & {
12051
- id: string;
12052
- createdAt: Date;
12053
- updatedAt: Date;
12054
- userId: string;
12055
- expiresAt: Date;
12056
- token: string;
12057
- ipAddress?: string | null | undefined;
12058
- userAgent?: string | null | undefined;
12059
- };
12060
- user: Record<string, any> & {
12061
- id: string;
12062
- createdAt: Date;
12063
- updatedAt: Date;
12064
- email: string;
12065
- emailVerified: boolean;
12066
- name: string;
12067
- image?: string | null | undefined;
12068
- };
12069
- };
12070
- }>)[];
12071
11943
  metadata: {
12072
11944
  openapi: {
12073
11945
  description: string;
@@ -12117,6 +11989,8 @@ declare function getTestInstance<O extends Partial<BetterAuthOptions>, C extends
12117
11989
  };
12118
11990
  query: zod.ZodOptional<zod.ZodObject<{
12119
11991
  accountId: zod.ZodOptional<zod.ZodString>;
11992
+ providerId: zod.ZodOptional<zod.ZodString>;
11993
+ userId: zod.ZodOptional<zod.ZodString>;
12120
11994
  }, zod_v4_core0.$strip>>;
12121
11995
  }, {
12122
11996
  user: _better_auth_core_oauth20.OAuth2UserInfo;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "better-auth",
3
- "version": "1.6.12",
3
+ "version": "1.6.14",
4
4
  "description": "The most comprehensive authentication framework for TypeScript.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -489,13 +489,13 @@
489
489
  "kysely": "^0.28.17 || ^0.29.0",
490
490
  "nanostores": "^1.1.1",
491
491
  "zod": "^4.3.6",
492
- "@better-auth/core": "1.6.12",
493
- "@better-auth/drizzle-adapter": "1.6.12",
494
- "@better-auth/memory-adapter": "1.6.12",
495
- "@better-auth/mongo-adapter": "1.6.12",
496
- "@better-auth/kysely-adapter": "1.6.12",
497
- "@better-auth/prisma-adapter": "1.6.12",
498
- "@better-auth/telemetry": "1.6.12"
492
+ "@better-auth/core": "1.6.14",
493
+ "@better-auth/drizzle-adapter": "1.6.14",
494
+ "@better-auth/kysely-adapter": "1.6.14",
495
+ "@better-auth/memory-adapter": "1.6.14",
496
+ "@better-auth/mongo-adapter": "1.6.14",
497
+ "@better-auth/prisma-adapter": "1.6.14",
498
+ "@better-auth/telemetry": "1.6.14"
499
499
  },
500
500
  "devDependencies": {
501
501
  "@lynx-js/react": "^0.116.3",