@better-auth/core 1.5.0-beta.7 → 1.5.0-beta.8

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.5.0-beta.7 build /home/runner/work/better-auth/better-auth/packages/core
2
+ > @better-auth/core@1.5.0-beta.8 build /home/runner/work/better-auth/better-auth/packages/core
3
3
  > tsdown
4
4
 
5
5
  ℹ tsdown v0.19.0 powered by rolldown v1.0.0-beta.59
@@ -25,7 +25,7 @@
25
25
  ℹ dist/utils/string.mjs  0.17 kB │ gzip: 0.14 kB
26
26
  ℹ dist/index.mjs  0.01 kB │ gzip: 0.03 kB
27
27
  ℹ dist/db/adapter/factory.mjs 30.11 kB │ gzip: 5.99 kB
28
- ℹ dist/db/get-tables.mjs  6.76 kB │ gzip: 1.29 kB
28
+ ℹ dist/db/get-tables.mjs  6.89 kB │ gzip: 1.30 kB
29
29
  ℹ dist/social-providers/cognito.mjs  5.90 kB │ gzip: 1.93 kB
30
30
  ℹ dist/social-providers/paypal.mjs  5.03 kB │ gzip: 1.48 kB
31
31
  ℹ dist/social-providers/apple.mjs  3.77 kB │ gzip: 1.36 kB
@@ -35,11 +35,11 @@
35
35
  ℹ dist/social-providers/line.mjs  3.57 kB │ gzip: 1.20 kB
36
36
  ℹ dist/social-providers/salesforce.mjs  3.50 kB │ gzip: 1.12 kB
37
37
  ℹ dist/social-providers/microsoft-entra-id.mjs  3.46 kB │ gzip: 1.22 kB
38
+ ℹ dist/social-providers/figma.mjs  2.78 kB │ gzip: 0.99 kB
38
39
  ℹ dist/oauth2/validate-authorization-code.mjs  2.76 kB │ gzip: 1.03 kB
39
40
  ℹ dist/social-providers/atlassian.mjs  2.75 kB │ gzip: 0.99 kB
40
41
  ℹ dist/social-providers/twitter.mjs  2.74 kB │ gzip: 0.92 kB
41
42
  ℹ dist/env/color-depth.mjs  2.72 kB │ gzip: 0.99 kB
42
- ℹ dist/social-providers/figma.mjs  2.71 kB │ gzip: 0.98 kB
43
43
  ℹ dist/social-providers/paybin.mjs  2.65 kB │ gzip: 0.97 kB
44
44
  ℹ dist/social-providers/gitlab.mjs  2.65 kB │ gzip: 0.96 kB
45
45
  ℹ dist/db/adapter/get-id-field.mjs  2.63 kB │ gzip: 0.98 kB
@@ -103,7 +103,7 @@
103
103
  ℹ dist/utils/string.d.mts  0.14 kB │ gzip: 0.12 kB
104
104
  ℹ dist/utils/json.d.mts  0.13 kB │ gzip: 0.13 kB
105
105
  ℹ dist/utils/id.d.mts  0.12 kB │ gzip: 0.12 kB
106
- ℹ dist/types/init-options.d.mts 38.16 kB │ gzip: 8.49 kB
106
+ ℹ dist/types/init-options.d.mts 38.29 kB │ gzip: 8.53 kB
107
107
  ℹ dist/types/context.d.mts 10.12 kB │ gzip: 2.96 kB
108
108
  ℹ dist/social-providers/zoom.d.mts  6.71 kB │ gzip: 2.29 kB
109
109
  ℹ dist/oauth2/oauth-provider.d.mts  5.92 kB │ gzip: 1.67 kB
@@ -176,5 +176,5 @@
176
176
  ℹ dist/db/schema/shared.d.mts  0.25 kB │ gzip: 0.18 kB
177
177
  ℹ dist/context/global.d.mts  0.20 kB │ gzip: 0.16 kB
178
178
  ℹ dist/env/color-depth.d.mts  0.12 kB │ gzip: 0.11 kB
179
- ℹ 169 files, total: 446.70 kB
180
- ✔ Build complete in 5631ms
179
+ ℹ 169 files, total: 447.03 kB
180
+ ✔ Build complete in 6053ms
@@ -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.5.0-beta.7";
5
+ const __betterAuthVersion = "1.5.0-beta.8";
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) {
@@ -260,6 +260,12 @@ type BetterAuthAdvancedOptions = {
260
260
  backgroundTasks?: {
261
261
  handler: (promise: Promise<void>) => void;
262
262
  };
263
+ /**
264
+ * Skip trailing slash validation in route matching
265
+ *
266
+ * @default false
267
+ */
268
+ skipTrailingSlashes?: boolean | undefined;
263
269
  };
264
270
  type BetterAuthOptions = {
265
271
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@better-auth/core",
3
- "version": "1.5.0-beta.7",
3
+ "version": "1.5.0-beta.8",
4
4
  "description": "The most comprehensive authentication framework for TypeScript.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -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) {
@@ -305,6 +305,12 @@ export type BetterAuthAdvancedOptions = {
305
305
  backgroundTasks?: {
306
306
  handler: (promise: Promise<void>) => void;
307
307
  };
308
+ /**
309
+ * Skip trailing slash validation in route matching
310
+ *
311
+ * @default false
312
+ */
313
+ skipTrailingSlashes?: boolean | undefined;
308
314
  };
309
315
 
310
316
  export type BetterAuthOptions = {