@better-auth/core 1.4.13 → 1.4.15

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,5 +1,5 @@
1
1
 
2
- > @better-auth/core@1.4.13 build /home/runner/work/better-auth/better-auth/packages/core
2
+ > @better-auth/core@1.4.15 build /home/runner/work/better-auth/better-auth/packages/core
3
3
  > tsdown
4
4
 
5
5
  ℹ tsdown v0.17.2 powered by rolldown v1.0.0-beta.53
@@ -20,7 +20,7 @@
20
20
  ℹ dist/error/index.mjs  0.33 kB │ gzip: 0.21 kB
21
21
  ℹ dist/index.mjs  0.01 kB │ gzip: 0.03 kB
22
22
  ℹ dist/db/adapter/factory.mjs 30.11 kB │ gzip: 5.99 kB
23
- ℹ dist/db/get-tables.mjs  6.76 kB │ gzip: 1.29 kB
23
+ ℹ dist/db/get-tables.mjs  6.89 kB │ gzip: 1.30 kB
24
24
  ℹ dist/social-providers/cognito.mjs  5.93 kB │ gzip: 1.93 kB
25
25
  ℹ dist/social-providers/paypal.mjs  5.03 kB │ gzip: 1.48 kB
26
26
  ℹ dist/social-providers/google.mjs  3.79 kB │ gzip: 1.39 kB
@@ -30,11 +30,11 @@
30
30
  ℹ dist/social-providers/line.mjs  3.57 kB │ gzip: 1.20 kB
31
31
  ℹ dist/social-providers/salesforce.mjs  3.50 kB │ gzip: 1.12 kB
32
32
  ℹ dist/social-providers/microsoft-entra-id.mjs  3.46 kB │ gzip: 1.22 kB
33
+ ℹ dist/social-providers/figma.mjs  2.78 kB │ gzip: 0.99 kB
33
34
  ℹ dist/oauth2/validate-authorization-code.mjs  2.76 kB │ gzip: 1.03 kB
34
35
  ℹ dist/social-providers/atlassian.mjs  2.75 kB │ gzip: 0.99 kB
35
36
  ℹ dist/social-providers/twitter.mjs  2.74 kB │ gzip: 0.92 kB
36
37
  ℹ dist/env/color-depth.mjs  2.72 kB │ gzip: 0.99 kB
37
- ℹ dist/social-providers/figma.mjs  2.71 kB │ gzip: 0.98 kB
38
38
  ℹ dist/db/adapter/get-id-field.mjs  2.67 kB │ gzip: 0.98 kB
39
39
  ℹ dist/social-providers/paybin.mjs  2.65 kB │ gzip: 0.97 kB
40
40
  ℹ dist/social-providers/gitlab.mjs  2.65 kB │ gzip: 0.96 kB
@@ -98,7 +98,7 @@
98
98
  ℹ dist/error/index.d.mts  0.27 kB │ gzip: 0.21 kB
99
99
  ℹ dist/async_hooks/index.d.mts  0.24 kB │ gzip: 0.16 kB
100
100
  ℹ dist/async_hooks/pure.index.d.mts  0.22 kB │ gzip: 0.16 kB
101
- ℹ dist/types/init-options.d.mts 38.19 kB │ gzip: 8.46 kB
101
+ ℹ dist/types/init-options.d.mts 38.32 kB │ gzip: 8.50 kB
102
102
  ℹ dist/types/context.d.mts  9.05 kB │ gzip: 2.65 kB
103
103
  ℹ dist/social-providers/zoom.d.mts  6.71 kB │ gzip: 2.29 kB
104
104
  ℹ dist/oauth2/oauth-provider.d.mts  5.92 kB │ gzip: 1.67 kB
@@ -176,5 +176,5 @@
176
176
  ℹ dist/utils/json.d.mts  0.13 kB │ gzip: 0.13 kB
177
177
  ℹ dist/utils/id.d.mts  0.12 kB │ gzip: 0.12 kB
178
178
  ℹ dist/env/color-depth.d.mts  0.12 kB │ gzip: 0.11 kB
179
- ℹ 169 files, total: 440.17 kB
180
- ✔ Build complete in 6537ms
179
+ ℹ 169 files, total: 440.50 kB
180
+ ✔ Build complete in 6540ms
@@ -2,7 +2,7 @@
2
2
  const symbol = Symbol.for("better-auth:global");
3
3
  let bind = null;
4
4
  const __context = {};
5
- const __betterAuthVersion = "1.4.13";
5
+ const __betterAuthVersion = "1.4.15";
6
6
  /**
7
7
  * We store context instance in the globalThis.
8
8
  *
@@ -159,26 +159,31 @@ const getAuthTables = (options) => {
159
159
  accessToken: {
160
160
  type: "string",
161
161
  required: false,
162
+ returned: false,
162
163
  fieldName: options.account?.fields?.accessToken || "accessToken"
163
164
  },
164
165
  refreshToken: {
165
166
  type: "string",
166
167
  required: false,
168
+ returned: false,
167
169
  fieldName: options.account?.fields?.refreshToken || "refreshToken"
168
170
  },
169
171
  idToken: {
170
172
  type: "string",
171
173
  required: false,
174
+ returned: false,
172
175
  fieldName: options.account?.fields?.idToken || "idToken"
173
176
  },
174
177
  accessTokenExpiresAt: {
175
178
  type: "date",
176
179
  required: false,
180
+ returned: false,
177
181
  fieldName: options.account?.fields?.accessTokenExpiresAt || "accessTokenExpiresAt"
178
182
  },
179
183
  refreshTokenExpiresAt: {
180
184
  type: "date",
181
185
  required: false,
186
+ returned: false,
182
187
  fieldName: options.account?.fields?.refreshTokenExpiresAt || "refreshTokenExpiresAt"
183
188
  },
184
189
  scope: {
@@ -189,6 +194,7 @@ const getAuthTables = (options) => {
189
194
  password: {
190
195
  type: "string",
191
196
  required: false,
197
+ returned: false,
192
198
  fieldName: options.account?.fields?.password || "password"
193
199
  },
194
200
  createdAt: {
@@ -18,7 +18,7 @@ const figma = (options) => {
18
18
  throw new BetterAuthError("CLIENT_ID_AND_SECRET_REQUIRED");
19
19
  }
20
20
  if (!codeVerifier) throw new BetterAuthError("codeVerifier is required for Figma");
21
- const _scopes = options.disableDefaultScope ? [] : ["file_read"];
21
+ const _scopes = options.disableDefaultScope ? [] : ["current_user:read"];
22
22
  if (options.scope) _scopes.push(...options.scope);
23
23
  if (scopes) _scopes.push(...scopes);
24
24
  return await createAuthorizationURL({
@@ -37,7 +37,8 @@ const figma = (options) => {
37
37
  codeVerifier,
38
38
  redirectURI,
39
39
  options,
40
- tokenEndpoint: "https://www.figma.com/api/oauth/token"
40
+ tokenEndpoint: "https://api.figma.com/v1/oauth/token",
41
+ authentication: "basic"
41
42
  });
42
43
  },
43
44
  refreshAccessToken: options.refreshAccessToken ? options.refreshAccessToken : async (refreshToken) => {
@@ -48,7 +49,8 @@ const figma = (options) => {
48
49
  clientKey: options.clientKey,
49
50
  clientSecret: options.clientSecret
50
51
  },
51
- tokenEndpoint: "https://www.figma.com/api/oauth/token"
52
+ tokenEndpoint: "https://api.figma.com/v1/oauth/token",
53
+ authentication: "basic"
52
54
  });
53
55
  },
54
56
  async getUserInfo(token) {
@@ -272,6 +272,12 @@ type BetterAuthAdvancedOptions = {
272
272
  backgroundTasks?: {
273
273
  handler: (promise: Promise<void>) => void;
274
274
  };
275
+ /**
276
+ * Skip trailing slash validation in route matching
277
+ *
278
+ * @default false
279
+ */
280
+ skipTrailingSlashes?: boolean | undefined;
275
281
  };
276
282
  type BetterAuthOptions = {
277
283
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/core",
3
- "version": "1.4.13",
3
+ "version": "1.4.15",
4
4
  "description": "The most comprehensive authentication framework for TypeScript.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -114,7 +114,7 @@
114
114
  "devDependencies": {
115
115
  "@better-auth/utils": "0.3.0",
116
116
  "@better-fetch/fetch": "1.1.21",
117
- "better-call": "1.1.7",
117
+ "better-call": "1.1.8",
118
118
  "jose": "^6.1.0",
119
119
  "kysely": "^0.28.5",
120
120
  "nanostores": "^1.0.1",
@@ -127,7 +127,7 @@
127
127
  "peerDependencies": {
128
128
  "@better-auth/utils": "0.3.0",
129
129
  "@better-fetch/fetch": "1.1.21",
130
- "better-call": "1.1.7",
130
+ "better-call": "1.1.8",
131
131
  "jose": "^6.1.0",
132
132
  "kysely": "^0.28.5",
133
133
  "nanostores": "^1.0.1"
@@ -183,21 +183,25 @@ export const getAuthTables = (
183
183
  accessToken: {
184
184
  type: "string",
185
185
  required: false,
186
+ returned: false,
186
187
  fieldName: options.account?.fields?.accessToken || "accessToken",
187
188
  },
188
189
  refreshToken: {
189
190
  type: "string",
190
191
  required: false,
192
+ returned: false,
191
193
  fieldName: options.account?.fields?.refreshToken || "refreshToken",
192
194
  },
193
195
  idToken: {
194
196
  type: "string",
195
197
  required: false,
198
+ returned: false,
196
199
  fieldName: options.account?.fields?.idToken || "idToken",
197
200
  },
198
201
  accessTokenExpiresAt: {
199
202
  type: "date",
200
203
  required: false,
204
+ returned: false,
201
205
  fieldName:
202
206
  options.account?.fields?.accessTokenExpiresAt ||
203
207
  "accessTokenExpiresAt",
@@ -205,6 +209,7 @@ export const getAuthTables = (
205
209
  refreshTokenExpiresAt: {
206
210
  type: "date",
207
211
  required: false,
212
+ returned: false,
208
213
  fieldName:
209
214
  options.account?.fields?.refreshTokenExpiresAt ||
210
215
  "refreshTokenExpiresAt",
@@ -217,6 +222,7 @@ export const getAuthTables = (
217
222
  password: {
218
223
  type: "string",
219
224
  required: false,
225
+ returned: false,
220
226
  fieldName: options.account?.fields?.password || "password",
221
227
  },
222
228
  createdAt: {
@@ -34,7 +34,7 @@ export const figma = (options: FigmaOptions) => {
34
34
  throw new BetterAuthError("codeVerifier is required for Figma");
35
35
  }
36
36
 
37
- const _scopes = options.disableDefaultScope ? [] : ["file_read"];
37
+ const _scopes = options.disableDefaultScope ? [] : ["current_user:read"];
38
38
  if (options.scope) _scopes.push(...options.scope);
39
39
  if (scopes) _scopes.push(...scopes);
40
40
 
@@ -56,7 +56,8 @@ export const figma = (options: FigmaOptions) => {
56
56
  codeVerifier,
57
57
  redirectURI,
58
58
  options,
59
- tokenEndpoint: "https://www.figma.com/api/oauth/token",
59
+ tokenEndpoint: "https://api.figma.com/v1/oauth/token",
60
+ authentication: "basic",
60
61
  });
61
62
  },
62
63
  refreshAccessToken: options.refreshAccessToken
@@ -69,7 +70,8 @@ export const figma = (options: FigmaOptions) => {
69
70
  clientKey: options.clientKey,
70
71
  clientSecret: options.clientSecret,
71
72
  },
72
- tokenEndpoint: "https://www.figma.com/api/oauth/token",
73
+ tokenEndpoint: "https://api.figma.com/v1/oauth/token",
74
+ authentication: "basic",
73
75
  });
74
76
  },
75
77
  async getUserInfo(token) {
@@ -311,6 +311,12 @@ export type BetterAuthAdvancedOptions = {
311
311
  backgroundTasks?: {
312
312
  handler: (promise: Promise<void>) => void;
313
313
  };
314
+ /**
315
+ * Skip trailing slash validation in route matching
316
+ *
317
+ * @default false
318
+ */
319
+ skipTrailingSlashes?: boolean | undefined;
314
320
  };
315
321
 
316
322
  export type BetterAuthOptions = {