@better-auth/core 1.4.2-beta.4 → 1.4.2

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.
@@ -1,13 +1,13 @@
1
1
 
2
- > @better-auth/core@1.4.2-beta.4 build /home/runner/work/better-auth/better-auth/packages/core
2
+ > @better-auth/core@1.4.2 build /home/runner/work/better-auth/better-auth/packages/core
3
3
  > tsdown
4
4
 
5
- ℹ tsdown v0.16.6 powered by rolldown v1.0.0-beta.51
5
+ ℹ tsdown v0.16.5 powered by rolldown v1.0.0-beta.50
6
6
  ℹ Using tsdown config: /home/runner/work/better-auth/better-auth/packages/core/tsdown.config.ts
7
7
  ℹ entry: src/index.ts, src/db/index.ts, src/db/adapter/index.ts, src/async_hooks/index.ts, src/context/index.ts, src/env/index.ts, src/oauth2/index.ts, src/api/index.ts, src/social-providers/index.ts, src/utils/index.ts, src/error/index.ts
8
8
  ℹ tsconfig: tsconfig.json
9
9
  ℹ Build start
10
- ℹ dist/social-providers/index.mjs  78.21 kB │ gzip: 10.17 kB
10
+ ℹ dist/social-providers/index.mjs  78.27 kB │ gzip: 10.18 kB
11
11
  ℹ dist/db/index.mjs  1.58 kB │ gzip: 0.49 kB
12
12
  ℹ dist/api/index.mjs  0.83 kB │ gzip: 0.40 kB
13
13
  ℹ dist/context/index.mjs  0.74 kB │ gzip: 0.27 kB
@@ -32,11 +32,11 @@
32
32
  ℹ dist/utils/index.d.mts  0.84 kB │ gzip: 0.43 kB
33
33
  ℹ dist/oauth2/index.d.mts  0.79 kB │ gzip: 0.30 kB
34
34
  ℹ dist/env/index.d.mts  0.59 kB │ gzip: 0.30 kB
35
- ℹ dist/db/adapter/index.d.mts  0.53 kB │ gzip: 0.24 kB
35
+ ℹ dist/db/adapter/index.d.mts  0.53 kB │ gzip: 0.25 kB
36
36
  ℹ dist/api/index.d.mts  0.29 kB │ gzip: 0.16 kB
37
37
  ℹ dist/async_hooks/index.d.mts  0.14 kB │ gzip: 0.10 kB
38
- ℹ dist/index-CkAWdKH8.d.mts 205.84 kB │ gzip: 32.50 kB
38
+ ℹ dist/index-BlxTbL2l.d.mts 205.91 kB │ gzip: 32.51 kB
39
39
  ℹ dist/index-CdubV7uy.d.mts  3.31 kB │ gzip: 1.11 kB
40
40
  ℹ dist/index-DgwIISs7.d.mts  0.24 kB │ gzip: 0.16 kB
41
- ℹ 31 files, total: 329.43 kB
42
- ✔ Build complete in 4651ms
41
+ ℹ 31 files, total: 329.56 kB
42
+ ✔ Build complete in 4669ms
@@ -1,3 +1,3 @@
1
- import { a as optionsMiddleware, i as createAuthMiddleware, n as AuthMiddleware, r as createAuthEndpoint, t as AuthEndpoint } from "../index-CkAWdKH8.mjs";
1
+ import { a as optionsMiddleware, i as createAuthMiddleware, n as AuthMiddleware, r as createAuthEndpoint, t as AuthEndpoint } from "../index-BlxTbL2l.mjs";
2
2
  import "../index-CdubV7uy.mjs";
3
3
  export { AuthEndpoint, AuthMiddleware, createAuthEndpoint, createAuthMiddleware, optionsMiddleware };
@@ -1,4 +1,4 @@
1
- import { Wn as DBAdapter, Yn as DBTransactionAdapter, f as AuthContext } from "../index-CkAWdKH8.mjs";
1
+ import { Wn as DBAdapter, Yn as DBTransactionAdapter, f as AuthContext } from "../index-BlxTbL2l.mjs";
2
2
  import "../index-CdubV7uy.mjs";
3
3
  import { t as AsyncLocalStorage } from "../index-DgwIISs7.mjs";
4
4
  import { EndpointContext, InputContext } from "better-call";
@@ -1,3 +1,3 @@
1
- import { Gn as DBAdapterDebugLogOption, Hn as CleanedWhere, Jn as DBAdapterSchemaCreation, Kn as DBAdapterFactoryConfig, Qn as Where, Un as CustomAdapter, Wn as DBAdapter, Xn as JoinConfig, Yn as DBTransactionAdapter, Zn as JoinOption, qn as DBAdapterInstance } from "../../index-CkAWdKH8.mjs";
1
+ import { Gn as DBAdapterDebugLogOption, Hn as CleanedWhere, Jn as DBAdapterSchemaCreation, Kn as DBAdapterFactoryConfig, Qn as Where, Un as CustomAdapter, Wn as DBAdapter, Xn as JoinConfig, Yn as DBTransactionAdapter, Zn as JoinOption, qn as DBAdapterInstance } from "../../index-BlxTbL2l.mjs";
2
2
  import "../../index-CdubV7uy.mjs";
3
3
  export { CleanedWhere, CustomAdapter, DBAdapter, DBAdapterDebugLogOption, DBAdapterFactoryConfig, DBAdapterInstance, DBAdapterSchemaCreation, DBTransactionAdapter, JoinConfig, JoinOption, Where };
@@ -1,3 +1,3 @@
1
- import { $n as AuthPluginSchema, Cr as SecondaryStorage, Sr as DBPrimitive, _r as BetterAuthDBSchema, ar as Verification, br as DBFieldType, cr as userSchema, dr as sessionSchema, er as BetterAuthDbSchema, fr as RateLimit, gr as BetterAuthPluginDBSchema, hr as accountSchema, ir as Primitive, lr as coreSchema, mr as Account, nr as FieldAttributeConfig, or as verificationSchema, pr as rateLimitSchema, rr as FieldType, sr as User, tr as FieldAttribute, ur as Session, vr as DBFieldAttribute, xr as DBPreservedModels, yr as DBFieldAttributeConfig } from "../index-CkAWdKH8.mjs";
1
+ import { $n as AuthPluginSchema, Cr as SecondaryStorage, Sr as DBPrimitive, _r as BetterAuthDBSchema, ar as Verification, br as DBFieldType, cr as userSchema, dr as sessionSchema, er as BetterAuthDbSchema, fr as RateLimit, gr as BetterAuthPluginDBSchema, hr as accountSchema, ir as Primitive, lr as coreSchema, mr as Account, nr as FieldAttributeConfig, or as verificationSchema, pr as rateLimitSchema, rr as FieldType, sr as User, tr as FieldAttribute, ur as Session, vr as DBFieldAttribute, xr as DBPreservedModels, yr as DBFieldAttributeConfig } from "../index-BlxTbL2l.mjs";
2
2
  import "../index-CdubV7uy.mjs";
3
3
  export { Account, AuthPluginSchema, BetterAuthDBSchema, BetterAuthDbSchema, BetterAuthPluginDBSchema, DBFieldAttribute, DBFieldAttributeConfig, DBFieldType, DBPreservedModels, DBPrimitive, FieldAttribute, FieldAttributeConfig, FieldType, Primitive, RateLimit, SecondaryStorage, Session, User, Verification, accountSchema, coreSchema, rateLimitSchema, sessionSchema, userSchema, verificationSchema };
@@ -1717,6 +1717,7 @@ declare const github: (options: GithubOptions) => {
1717
1717
  state,
1718
1718
  scopes,
1719
1719
  loginHint,
1720
+ codeVerifier,
1720
1721
  redirectURI
1721
1722
  }: {
1722
1723
  state: string;
@@ -1728,6 +1729,7 @@ declare const github: (options: GithubOptions) => {
1728
1729
  }): Promise<URL>;
1729
1730
  validateAuthorizationCode: ({
1730
1731
  code,
1732
+ codeVerifier,
1731
1733
  redirectURI
1732
1734
  }: {
1733
1735
  code: string;
@@ -4453,6 +4455,7 @@ declare const socialProviders: {
4453
4455
  state,
4454
4456
  scopes,
4455
4457
  loginHint,
4458
+ codeVerifier,
4456
4459
  redirectURI
4457
4460
  }: {
4458
4461
  state: string;
@@ -4464,6 +4467,7 @@ declare const socialProviders: {
4464
4467
  }): Promise<URL>;
4465
4468
  validateAuthorizationCode: ({
4466
4469
  code,
4470
+ codeVerifier,
4467
4471
  redirectURI
4468
4472
  }: {
4469
4473
  code: string;
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { Dn as BetterAuthCookies, En as LiteralUnion, Tn as LiteralString, _ as BetterAuthRateLimitOptions, b as HookEndpointContext, c as BetterAuthClientPlugin, d as ClientStore, f as AuthContext, g as BetterAuthOptions, h as BetterAuthAdvancedOptions, l as ClientAtomListener, m as InternalAdapter, o as StandardSchemaV1, p as GenericEndpointContext, s as BetterAuthClientOptions, u as ClientFetchOption, v as GenerateIdFn, y as BetterAuthPlugin } from "./index-CkAWdKH8.mjs";
1
+ import { Dn as BetterAuthCookies, En as LiteralUnion, Tn as LiteralString, _ as BetterAuthRateLimitOptions, b as HookEndpointContext, c as BetterAuthClientPlugin, d as ClientStore, f as AuthContext, g as BetterAuthOptions, h as BetterAuthAdvancedOptions, l as ClientAtomListener, m as InternalAdapter, o as StandardSchemaV1, p as GenericEndpointContext, s as BetterAuthClientOptions, u as ClientFetchOption, v as GenerateIdFn, y as BetterAuthPlugin } from "./index-BlxTbL2l.mjs";
2
2
  import "./index-CdubV7uy.mjs";
3
3
  export { AuthContext, BetterAuthAdvancedOptions, BetterAuthClientOptions, BetterAuthClientPlugin, BetterAuthCookies, BetterAuthOptions, BetterAuthPlugin, BetterAuthRateLimitOptions, ClientAtomListener, ClientFetchOption, ClientStore, GenerateIdFn, GenericEndpointContext, HookEndpointContext, InternalAdapter, LiteralString, LiteralUnion, StandardSchemaV1 };
@@ -1,3 +1,3 @@
1
- import { An as validateToken, Bn as OAuthProvider, Fn as createAuthorizationURL, In as clientCredentialsToken, Ln as createClientCredentialsTokenRequest, Mn as getOAuth2Tokens, Nn as createRefreshAccessTokenRequest, On as createAuthorizationCodeRequest, Pn as refreshAccessToken, Rn as OAuth2Tokens, Vn as ProviderOptions, jn as generateCodeChallenge, kn as validateAuthorizationCode, zn as OAuth2UserInfo } from "../index-CkAWdKH8.mjs";
1
+ import { An as validateToken, Bn as OAuthProvider, Fn as createAuthorizationURL, In as clientCredentialsToken, Ln as createClientCredentialsTokenRequest, Mn as getOAuth2Tokens, Nn as createRefreshAccessTokenRequest, On as createAuthorizationCodeRequest, Pn as refreshAccessToken, Rn as OAuth2Tokens, Vn as ProviderOptions, jn as generateCodeChallenge, kn as validateAuthorizationCode, zn as OAuth2UserInfo } from "../index-BlxTbL2l.mjs";
2
2
  import "../index-CdubV7uy.mjs";
3
3
  export { OAuth2Tokens, OAuth2UserInfo, OAuthProvider, ProviderOptions, clientCredentialsToken, createAuthorizationCodeRequest, createAuthorizationURL, createClientCredentialsTokenRequest, createRefreshAccessTokenRequest, generateCodeChallenge, getOAuth2Tokens, refreshAccessToken, validateAuthorizationCode, validateToken };
@@ -1,3 +1,3 @@
1
- import { $ as PronounOption, $t as MicrosoftOptions, A as PayPalOptions, At as kick, B as line, Bt as SpotifyOptions, C as SocialProviderListEnum, Cn as apple, Ct as linkedin, D as PolarOptions, Dt as linear, E as socialProviders, Et as LinearUser, F as PaybinProfile, Ft as TwitterProfile, G as KakaoProfile, Gt as slack, H as NaverProfile, Ht as spotify, I as paybin, It as twitter, J as NotionProfile, Jt as huggingface, K as kakao, Kt as HuggingFaceOptions, L as LineIdTokenPayload, Lt as TwitchOptions, M as PayPalTokenResponse, Mt as DropboxProfile, N as paypal, Nt as dropbox, O as PolarProfile, Ot as KickOptions, P as PaybinOptions, Pt as TwitterOption, Q as PhoneNumber, Qt as MicrosoftEntraIDProfile, R as LineOptions, Rt as TwitchProfile, S as SocialProviderList, Sn as AppleProfile, St as LinkedInProfile, T as socialProviderList, Tt as LinearProfile, U as naver, Ut as SlackOptions, V as NaverOptions, Vt as SpotifyProfile, W as KakaoOptions, Wt as SlackProfile, X as AccountStatus, Xt as GoogleProfile, Y as notion, Yt as GoogleOptions, Z as LoginType, Zt as google, _n as AtlassianOptions, _t as tiktok, an as FigmaProfile, at as vk, bn as AppleNonConformUser, bt as gitlab, cn as FacebookProfile, ct as salesforce, dn as DiscordProfile, dt as roblox, en as microsoft, et as ZoomOptions, fn as discord, ft as RedditOptions, gn as getCognitoPublicKey, gt as TiktokProfile, hn as cognito, ht as TiktokOptions, in as FigmaOptions, it as VkProfile, j as PayPalProfile, jt as DropboxOptions, k as polar, kt as KickProfile, ln as facebook, lt as RobloxOptions, mn as CognitoProfile, mt as reddit, nn as GithubProfile, nt as zoom, on as figma, ot as SalesforceOptions, pn as CognitoOptions, pt as RedditProfile, q as NotionOptions, qt as HuggingFaceProfile, rn as github, rt as VkOption, sn as FacebookOptions, st as SalesforceProfile, tn as GithubOptions, tt as ZoomProfile, un as DiscordOptions, ut as RobloxProfile, vn as AtlassianProfile, vt as GitlabOptions, w as SocialProviders, wn as getApplePublicKey, wt as LinearOptions, x as SocialProvider, xn as AppleOptions, xt as LinkedInOptions, yn as atlassian, yt as GitlabProfile, z as LineUserInfo, zt as twitch } from "../index-CkAWdKH8.mjs";
1
+ import { $ as PronounOption, $t as MicrosoftOptions, A as PayPalOptions, At as kick, B as line, Bt as SpotifyOptions, C as SocialProviderListEnum, Cn as apple, Ct as linkedin, D as PolarOptions, Dt as linear, E as socialProviders, Et as LinearUser, F as PaybinProfile, Ft as TwitterProfile, G as KakaoProfile, Gt as slack, H as NaverProfile, Ht as spotify, I as paybin, It as twitter, J as NotionProfile, Jt as huggingface, K as kakao, Kt as HuggingFaceOptions, L as LineIdTokenPayload, Lt as TwitchOptions, M as PayPalTokenResponse, Mt as DropboxProfile, N as paypal, Nt as dropbox, O as PolarProfile, Ot as KickOptions, P as PaybinOptions, Pt as TwitterOption, Q as PhoneNumber, Qt as MicrosoftEntraIDProfile, R as LineOptions, Rt as TwitchProfile, S as SocialProviderList, Sn as AppleProfile, St as LinkedInProfile, T as socialProviderList, Tt as LinearProfile, U as naver, Ut as SlackOptions, V as NaverOptions, Vt as SpotifyProfile, W as KakaoOptions, Wt as SlackProfile, X as AccountStatus, Xt as GoogleProfile, Y as notion, Yt as GoogleOptions, Z as LoginType, Zt as google, _n as AtlassianOptions, _t as tiktok, an as FigmaProfile, at as vk, bn as AppleNonConformUser, bt as gitlab, cn as FacebookProfile, ct as salesforce, dn as DiscordProfile, dt as roblox, en as microsoft, et as ZoomOptions, fn as discord, ft as RedditOptions, gn as getCognitoPublicKey, gt as TiktokProfile, hn as cognito, ht as TiktokOptions, in as FigmaOptions, it as VkProfile, j as PayPalProfile, jt as DropboxOptions, k as polar, kt as KickProfile, ln as facebook, lt as RobloxOptions, mn as CognitoProfile, mt as reddit, nn as GithubProfile, nt as zoom, on as figma, ot as SalesforceOptions, pn as CognitoOptions, pt as RedditProfile, q as NotionOptions, qt as HuggingFaceProfile, rn as github, rt as VkOption, sn as FacebookOptions, st as SalesforceProfile, tn as GithubOptions, tt as ZoomProfile, un as DiscordOptions, ut as RobloxProfile, vn as AtlassianProfile, vt as GitlabOptions, w as SocialProviders, wn as getApplePublicKey, wt as LinearOptions, x as SocialProvider, xn as AppleOptions, xt as LinkedInOptions, yn as atlassian, yt as GitlabProfile, z as LineUserInfo, zt as twitch } from "../index-BlxTbL2l.mjs";
2
2
  import "../index-CdubV7uy.mjs";
3
3
  export { AccountStatus, AppleNonConformUser, AppleOptions, AppleProfile, AtlassianOptions, AtlassianProfile, CognitoOptions, CognitoProfile, DiscordOptions, DiscordProfile, DropboxOptions, DropboxProfile, FacebookOptions, FacebookProfile, FigmaOptions, FigmaProfile, GithubOptions, GithubProfile, GitlabOptions, GitlabProfile, GoogleOptions, GoogleProfile, HuggingFaceOptions, HuggingFaceProfile, KakaoOptions, KakaoProfile, KickOptions, KickProfile, LineIdTokenPayload, LineOptions, LineUserInfo, LinearOptions, LinearProfile, LinearUser, LinkedInOptions, LinkedInProfile, LoginType, MicrosoftEntraIDProfile, MicrosoftOptions, NaverOptions, NaverProfile, NotionOptions, NotionProfile, PayPalOptions, PayPalProfile, PayPalTokenResponse, PaybinOptions, PaybinProfile, PhoneNumber, PolarOptions, PolarProfile, PronounOption, RedditOptions, RedditProfile, RobloxOptions, RobloxProfile, SalesforceOptions, SalesforceProfile, SlackOptions, SlackProfile, SocialProvider, SocialProviderList, SocialProviderListEnum, SocialProviders, SpotifyOptions, SpotifyProfile, TiktokOptions, TiktokProfile, TwitchOptions, TwitchProfile, TwitterOption, TwitterProfile, VkOption, VkProfile, ZoomOptions, ZoomProfile, apple, atlassian, cognito, discord, dropbox, facebook, figma, getApplePublicKey, getCognitoPublicKey, github, gitlab, google, huggingface, kakao, kick, line, linear, linkedin, microsoft, naver, notion, paybin, paypal, polar, reddit, roblox, salesforce, slack, socialProviderList, socialProviders, spotify, tiktok, twitch, twitter, vk, zoom };
@@ -637,7 +637,7 @@ const github = (options) => {
637
637
  return {
638
638
  id: "github",
639
639
  name: "GitHub",
640
- createAuthorizationURL({ state, scopes, loginHint, redirectURI }) {
640
+ createAuthorizationURL({ state, scopes, loginHint, codeVerifier, redirectURI }) {
641
641
  const _scopes = options.disableDefaultScope ? [] : ["read:user", "user:email"];
642
642
  if (options.scope) _scopes.push(...options.scope);
643
643
  if (scopes) _scopes.push(...scopes);
@@ -647,14 +647,16 @@ const github = (options) => {
647
647
  authorizationEndpoint: "https://github.com/login/oauth/authorize",
648
648
  scopes: _scopes,
649
649
  state,
650
+ codeVerifier,
650
651
  redirectURI,
651
652
  loginHint,
652
653
  prompt: options.prompt
653
654
  });
654
655
  },
655
- validateAuthorizationCode: async ({ code, redirectURI }) => {
656
+ validateAuthorizationCode: async ({ code, codeVerifier, redirectURI }) => {
656
657
  return validateAuthorizationCode({
657
658
  code,
659
+ codeVerifier,
658
660
  redirectURI,
659
661
  options,
660
662
  tokenEndpoint
package/package.json CHANGED
@@ -1,13 +1,8 @@
1
1
  {
2
2
  "name": "@better-auth/core",
3
- "version": "1.4.2-beta.4",
3
+ "version": "1.4.2",
4
4
  "description": "The most comprehensive authentication framework for TypeScript.",
5
5
  "type": "module",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/better-auth/better-auth",
9
- "directory": "packages/core"
10
- },
11
6
  "main": "./dist/index.mjs",
12
7
  "module": "./dist/index.mjs",
13
8
  "exports": {
@@ -113,7 +108,7 @@
113
108
  "jose": "^6.1.0",
114
109
  "kysely": "^0.28.5",
115
110
  "nanostores": "^1.0.1",
116
- "tsdown": "^0.16.6"
111
+ "tsdown": "^0.16.0"
117
112
  },
118
113
  "dependencies": {
119
114
  "@standard-schema/spec": "^1.0.0",
@@ -61,7 +61,13 @@ export const github = (options: GithubOptions) => {
61
61
  return {
62
62
  id: "github",
63
63
  name: "GitHub",
64
- createAuthorizationURL({ state, scopes, loginHint, redirectURI }) {
64
+ createAuthorizationURL({
65
+ state,
66
+ scopes,
67
+ loginHint,
68
+ codeVerifier,
69
+ redirectURI,
70
+ }) {
65
71
  const _scopes = options.disableDefaultScope
66
72
  ? []
67
73
  : ["read:user", "user:email"];
@@ -73,14 +79,16 @@ export const github = (options: GithubOptions) => {
73
79
  authorizationEndpoint: "https://github.com/login/oauth/authorize",
74
80
  scopes: _scopes,
75
81
  state,
82
+ codeVerifier,
76
83
  redirectURI,
77
84
  loginHint,
78
85
  prompt: options.prompt,
79
86
  });
80
87
  },
81
- validateAuthorizationCode: async ({ code, redirectURI }) => {
88
+ validateAuthorizationCode: async ({ code, codeVerifier, redirectURI }) => {
82
89
  return validateAuthorizationCode({
83
90
  code,
91
+ codeVerifier,
84
92
  redirectURI,
85
93
  options,
86
94
  tokenEndpoint,