better-auth 0.4.1 → 0.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.
- package/dist/.DS_Store +0 -0
- package/dist/adapters/drizzle.d.ts +2 -2
- package/dist/adapters/mongodb.d.ts +2 -2
- package/dist/adapters/prisma.d.ts +2 -2
- package/dist/api.d.ts +2 -2
- package/dist/api.js +82 -79
- package/dist/cli.js +4 -5
- package/dist/client/plugins.d.ts +4 -4
- package/dist/client.d.ts +2 -2
- package/dist/{index-DCBFTxDp.d.ts → index-BOgQnoz7.d.ts} +2 -2
- package/dist/{index-C6jmDLjB.d.ts → index-C-85i2-P.d.ts} +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +82 -79
- package/dist/next-js.d.ts +2 -2
- package/dist/node.d.ts +2 -2
- package/dist/plugins.d.ts +4 -4
- package/dist/plugins.js +83 -80
- package/dist/react.d.ts +2 -2
- package/dist/social.d.ts +1 -1
- package/dist/social.js +82 -79
- package/dist/solid-start.d.ts +2 -2
- package/dist/solid.d.ts +2 -2
- package/dist/svelte-kit.d.ts +2 -2
- package/dist/svelte.d.ts +2 -2
- package/dist/{types-Bs23H3QM.d.ts → types-DoyeJ_dw.d.ts} +8 -8
- package/dist/types.d.ts +4 -4
- package/dist/vue.d.ts +2 -2
- package/package.json +3 -8
package/dist/social.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// src/social-providers/apple.ts
|
|
2
|
-
import "arctic";
|
|
3
2
|
import { parseJWT } from "oslo/jwt";
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
// src/social-providers/utils.ts
|
|
5
|
+
import { OAuth2Tokens } from "arctic";
|
|
5
6
|
|
|
6
7
|
// src/error/better-auth-error.ts
|
|
7
8
|
var BetterAuthError = class extends Error {
|
|
@@ -14,9 +15,6 @@ var BetterAuthError = class extends Error {
|
|
|
14
15
|
}
|
|
15
16
|
};
|
|
16
17
|
|
|
17
|
-
// src/social-providers/utils.ts
|
|
18
|
-
import { OAuth2Tokens } from "arctic";
|
|
19
|
-
|
|
20
18
|
// src/utils/base-url.ts
|
|
21
19
|
function checkHasPath(url) {
|
|
22
20
|
try {
|
|
@@ -93,7 +91,15 @@ function generateCodeChallenge(codeVerifier) {
|
|
|
93
91
|
includePadding: false
|
|
94
92
|
});
|
|
95
93
|
}
|
|
96
|
-
function createAuthorizationURL(
|
|
94
|
+
function createAuthorizationURL({
|
|
95
|
+
id,
|
|
96
|
+
options,
|
|
97
|
+
authorizationEndpoint,
|
|
98
|
+
state,
|
|
99
|
+
codeVerifier,
|
|
100
|
+
scopes,
|
|
101
|
+
disablePkce
|
|
102
|
+
}) {
|
|
97
103
|
const url = new URL(authorizationEndpoint);
|
|
98
104
|
url.searchParams.set("response_type", "code");
|
|
99
105
|
url.searchParams.set("client_id", options.clientId);
|
|
@@ -103,7 +109,7 @@ function createAuthorizationURL(id, options, authorizationEndpoint, state, codeV
|
|
|
103
109
|
"redirect_uri",
|
|
104
110
|
options.redirectURI || getRedirectURI(id)
|
|
105
111
|
);
|
|
106
|
-
if (!disablePkce) {
|
|
112
|
+
if (!disablePkce && codeVerifier) {
|
|
107
113
|
const codeChallenge = generateCodeChallenge(codeVerifier);
|
|
108
114
|
url.searchParams.set("code_challenge_method", "S256");
|
|
109
115
|
url.searchParams.set("code_challenge", codeChallenge);
|
|
@@ -151,7 +157,7 @@ var apple = (options) => {
|
|
|
151
157
|
};
|
|
152
158
|
|
|
153
159
|
// src/social-providers/discord.ts
|
|
154
|
-
import { betterFetch as
|
|
160
|
+
import { betterFetch as betterFetch2 } from "@better-fetch/fetch";
|
|
155
161
|
var discord = (options) => {
|
|
156
162
|
return {
|
|
157
163
|
id: "discord",
|
|
@@ -175,7 +181,7 @@ var discord = (options) => {
|
|
|
175
181
|
});
|
|
176
182
|
},
|
|
177
183
|
async getUserInfo(token) {
|
|
178
|
-
const { data: profile, error } = await
|
|
184
|
+
const { data: profile, error } = await betterFetch2(
|
|
179
185
|
"https://discord.com/api/users/@me",
|
|
180
186
|
{
|
|
181
187
|
headers: {
|
|
@@ -208,20 +214,21 @@ var discord = (options) => {
|
|
|
208
214
|
};
|
|
209
215
|
|
|
210
216
|
// src/social-providers/facebook.ts
|
|
211
|
-
import { betterFetch as
|
|
212
|
-
import { Facebook } from "arctic";
|
|
217
|
+
import { betterFetch as betterFetch3 } from "@better-fetch/fetch";
|
|
213
218
|
var facebook = (options) => {
|
|
214
|
-
const facebookArctic = new Facebook(
|
|
215
|
-
options.clientId,
|
|
216
|
-
options.clientSecret,
|
|
217
|
-
getRedirectURI("facebook", options.redirectURI)
|
|
218
|
-
);
|
|
219
219
|
return {
|
|
220
220
|
id: "facebook",
|
|
221
221
|
name: "Facebook",
|
|
222
|
-
createAuthorizationURL({ state, scopes }) {
|
|
222
|
+
createAuthorizationURL({ state, scopes, codeVerifier }) {
|
|
223
223
|
const _scopes = options.scope || scopes || ["email", "public_profile"];
|
|
224
|
-
return
|
|
224
|
+
return createAuthorizationURL({
|
|
225
|
+
id: "facebook",
|
|
226
|
+
options,
|
|
227
|
+
authorizationEndpoint: "https://www.facebook.com/v16.0/dialog/oauth",
|
|
228
|
+
scopes: _scopes,
|
|
229
|
+
state,
|
|
230
|
+
codeVerifier
|
|
231
|
+
});
|
|
225
232
|
},
|
|
226
233
|
validateAuthorizationCode: async (code, codeVerifier, redirectURI) => {
|
|
227
234
|
return validateAuthorizationCode({
|
|
@@ -233,7 +240,7 @@ var facebook = (options) => {
|
|
|
233
240
|
});
|
|
234
241
|
},
|
|
235
242
|
async getUserInfo(token) {
|
|
236
|
-
const { data: profile, error } = await
|
|
243
|
+
const { data: profile, error } = await betterFetch3(
|
|
237
244
|
"https://graph.facebook.com/me",
|
|
238
245
|
{
|
|
239
246
|
auth: {
|
|
@@ -259,21 +266,22 @@ var facebook = (options) => {
|
|
|
259
266
|
};
|
|
260
267
|
|
|
261
268
|
// src/social-providers/github.ts
|
|
262
|
-
import { betterFetch as
|
|
263
|
-
import { GitHub } from "arctic";
|
|
269
|
+
import { betterFetch as betterFetch4 } from "@better-fetch/fetch";
|
|
264
270
|
var github = (options) => {
|
|
265
|
-
const githubArctic = new GitHub(
|
|
266
|
-
options.clientId,
|
|
267
|
-
options.clientSecret,
|
|
268
|
-
getRedirectURI("github", options.redirectURI)
|
|
269
|
-
);
|
|
270
271
|
const tokenEndpoint = "https://github.com/login/oauth/access_token";
|
|
271
272
|
return {
|
|
272
273
|
id: "github",
|
|
273
274
|
name: "Github",
|
|
274
|
-
createAuthorizationURL({ state, scopes }) {
|
|
275
|
+
createAuthorizationURL({ state, scopes, codeVerifier }) {
|
|
275
276
|
const _scopes = options.scope || scopes || ["user:email"];
|
|
276
|
-
return
|
|
277
|
+
return createAuthorizationURL({
|
|
278
|
+
id: "github",
|
|
279
|
+
options,
|
|
280
|
+
authorizationEndpoint: "https://github.com/login/oauth/authorize",
|
|
281
|
+
scopes: _scopes,
|
|
282
|
+
state,
|
|
283
|
+
codeVerifier
|
|
284
|
+
});
|
|
277
285
|
},
|
|
278
286
|
validateAuthorizationCode: async (code, _, redirect) => {
|
|
279
287
|
return validateAuthorizationCode({
|
|
@@ -284,7 +292,7 @@ var github = (options) => {
|
|
|
284
292
|
});
|
|
285
293
|
},
|
|
286
294
|
async getUserInfo(token) {
|
|
287
|
-
const { data: profile, error } = await
|
|
295
|
+
const { data: profile, error } = await betterFetch4(
|
|
288
296
|
"https://api.github.com/user",
|
|
289
297
|
{
|
|
290
298
|
auth: {
|
|
@@ -298,7 +306,7 @@ var github = (options) => {
|
|
|
298
306
|
}
|
|
299
307
|
let emailVerified = false;
|
|
300
308
|
if (!profile.email) {
|
|
301
|
-
const { data, error: error2 } = await
|
|
309
|
+
const { data, error: error2 } = await betterFetch4("https://api.github.com/user/emails", {
|
|
302
310
|
auth: {
|
|
303
311
|
type: "Bearer",
|
|
304
312
|
token: token.accessToken()
|
|
@@ -324,7 +332,6 @@ var github = (options) => {
|
|
|
324
332
|
};
|
|
325
333
|
|
|
326
334
|
// src/social-providers/google.ts
|
|
327
|
-
import { Google } from "arctic";
|
|
328
335
|
import { parseJWT as parseJWT2 } from "oslo/jwt";
|
|
329
336
|
|
|
330
337
|
// src/utils/logger.ts
|
|
@@ -371,11 +378,6 @@ var logger = createLogger();
|
|
|
371
378
|
|
|
372
379
|
// src/social-providers/google.ts
|
|
373
380
|
var google = (options) => {
|
|
374
|
-
const googleArctic = new Google(
|
|
375
|
-
options.clientId,
|
|
376
|
-
options.clientSecret,
|
|
377
|
-
getRedirectURI("google", options.redirectURI)
|
|
378
|
-
);
|
|
379
381
|
return {
|
|
380
382
|
id: "google",
|
|
381
383
|
name: "Google",
|
|
@@ -390,11 +392,14 @@ var google = (options) => {
|
|
|
390
392
|
throw new BetterAuthError("codeVerifier is required for Google");
|
|
391
393
|
}
|
|
392
394
|
const _scopes = options.scope || scopes || ["email", "profile"];
|
|
393
|
-
const url =
|
|
395
|
+
const url = createAuthorizationURL({
|
|
396
|
+
id: "google",
|
|
397
|
+
options,
|
|
398
|
+
authorizationEndpoint: "https://accounts.google.com/o/oauth2/auth",
|
|
399
|
+
scopes: _scopes,
|
|
394
400
|
state,
|
|
395
|
-
codeVerifier
|
|
396
|
-
|
|
397
|
-
);
|
|
401
|
+
codeVerifier
|
|
402
|
+
});
|
|
398
403
|
return url;
|
|
399
404
|
},
|
|
400
405
|
validateAuthorizationCode: async (code, codeVerifier, redirectURI) => {
|
|
@@ -426,7 +431,7 @@ var google = (options) => {
|
|
|
426
431
|
};
|
|
427
432
|
|
|
428
433
|
// src/social-providers/microsoft-entra-id.ts
|
|
429
|
-
import { betterFetch as
|
|
434
|
+
import { betterFetch as betterFetch5 } from "@better-fetch/fetch";
|
|
430
435
|
import { parseJWT as parseJWT3 } from "oslo/jwt";
|
|
431
436
|
var microsoft = (options) => {
|
|
432
437
|
const tenant = options.tenantId || "common";
|
|
@@ -437,14 +442,14 @@ var microsoft = (options) => {
|
|
|
437
442
|
name: "Microsoft EntraID",
|
|
438
443
|
createAuthorizationURL(data) {
|
|
439
444
|
const scopes = options.scope || data.scopes || ["openid", "profile", "email", "User.Read"];
|
|
440
|
-
return createAuthorizationURL(
|
|
441
|
-
"microsoft",
|
|
445
|
+
return createAuthorizationURL({
|
|
446
|
+
id: "microsoft",
|
|
442
447
|
options,
|
|
443
448
|
authorizationEndpoint,
|
|
444
|
-
data.state,
|
|
445
|
-
data.codeVerifier,
|
|
449
|
+
state: data.state,
|
|
450
|
+
codeVerifier: data.codeVerifier,
|
|
446
451
|
scopes
|
|
447
|
-
);
|
|
452
|
+
});
|
|
448
453
|
},
|
|
449
454
|
validateAuthorizationCode(code, codeVerifier, redirectURI) {
|
|
450
455
|
return validateAuthorizationCode({
|
|
@@ -458,7 +463,7 @@ var microsoft = (options) => {
|
|
|
458
463
|
async getUserInfo(token) {
|
|
459
464
|
const user = parseJWT3(token.idToken())?.payload;
|
|
460
465
|
const profilePhotoSize = options.profilePhotoSize || 48;
|
|
461
|
-
await
|
|
466
|
+
await betterFetch5(
|
|
462
467
|
`https://graph.microsoft.com/v1.0/me/photos/${profilePhotoSize}x${profilePhotoSize}/$value`,
|
|
463
468
|
{
|
|
464
469
|
headers: {
|
|
@@ -494,20 +499,21 @@ var microsoft = (options) => {
|
|
|
494
499
|
};
|
|
495
500
|
|
|
496
501
|
// src/social-providers/spotify.ts
|
|
497
|
-
import { betterFetch as
|
|
498
|
-
import { Spotify } from "arctic";
|
|
502
|
+
import { betterFetch as betterFetch6 } from "@better-fetch/fetch";
|
|
499
503
|
var spotify = (options) => {
|
|
500
|
-
const spotifyArctic = new Spotify(
|
|
501
|
-
options.clientId,
|
|
502
|
-
options.clientSecret,
|
|
503
|
-
getRedirectURI("spotify", options.redirectURI)
|
|
504
|
-
);
|
|
505
504
|
return {
|
|
506
505
|
id: "spotify",
|
|
507
506
|
name: "Spotify",
|
|
508
|
-
createAuthorizationURL({ state, scopes }) {
|
|
507
|
+
createAuthorizationURL({ state, scopes, codeVerifier }) {
|
|
509
508
|
const _scopes = options.scope || scopes || ["user-read-email"];
|
|
510
|
-
return
|
|
509
|
+
return createAuthorizationURL({
|
|
510
|
+
id: "spotify",
|
|
511
|
+
options,
|
|
512
|
+
authorizationEndpoint: "https://accounts.spotify.com/authorize",
|
|
513
|
+
scopes: _scopes,
|
|
514
|
+
state,
|
|
515
|
+
codeVerifier
|
|
516
|
+
});
|
|
511
517
|
},
|
|
512
518
|
validateAuthorizationCode: async (code, codeVerifier, redirectURI) => {
|
|
513
519
|
return validateAuthorizationCode({
|
|
@@ -519,7 +525,7 @@ var spotify = (options) => {
|
|
|
519
525
|
});
|
|
520
526
|
},
|
|
521
527
|
async getUserInfo(token) {
|
|
522
|
-
const { data: profile, error } = await
|
|
528
|
+
const { data: profile, error } = await betterFetch6(
|
|
523
529
|
"https://api.spotify.com/v1/me",
|
|
524
530
|
{
|
|
525
531
|
method: "GET",
|
|
@@ -546,20 +552,20 @@ var spotify = (options) => {
|
|
|
546
552
|
};
|
|
547
553
|
|
|
548
554
|
// src/social-providers/twitch.ts
|
|
549
|
-
import { betterFetch as
|
|
550
|
-
import { Twitch } from "arctic";
|
|
555
|
+
import { betterFetch as betterFetch7 } from "@better-fetch/fetch";
|
|
551
556
|
var twitch = (options) => {
|
|
552
|
-
const twitchArctic = new Twitch(
|
|
553
|
-
options.clientId,
|
|
554
|
-
options.clientSecret,
|
|
555
|
-
getRedirectURI("twitch", options.redirectURI)
|
|
556
|
-
);
|
|
557
557
|
return {
|
|
558
558
|
id: "twitch",
|
|
559
559
|
name: "Twitch",
|
|
560
560
|
createAuthorizationURL({ state, scopes }) {
|
|
561
561
|
const _scopes = options.scope || scopes || ["activity:write", "read"];
|
|
562
|
-
return
|
|
562
|
+
return createAuthorizationURL({
|
|
563
|
+
id: "twitch",
|
|
564
|
+
options,
|
|
565
|
+
authorizationEndpoint: "https://id.twitch.tv/oauth2/authorize",
|
|
566
|
+
scopes: _scopes,
|
|
567
|
+
state
|
|
568
|
+
});
|
|
563
569
|
},
|
|
564
570
|
validateAuthorizationCode: async (code, codeVerifier, redirectURI) => {
|
|
565
571
|
return validateAuthorizationCode({
|
|
@@ -570,7 +576,7 @@ var twitch = (options) => {
|
|
|
570
576
|
});
|
|
571
577
|
},
|
|
572
578
|
async getUserInfo(token) {
|
|
573
|
-
const { data: profile, error } = await
|
|
579
|
+
const { data: profile, error } = await betterFetch7(
|
|
574
580
|
"https://api.twitch.tv/helix/users",
|
|
575
581
|
{
|
|
576
582
|
method: "GET",
|
|
@@ -597,24 +603,21 @@ var twitch = (options) => {
|
|
|
597
603
|
};
|
|
598
604
|
|
|
599
605
|
// src/social-providers/twitter.ts
|
|
600
|
-
import { betterFetch as
|
|
601
|
-
import { Twitter } from "arctic";
|
|
606
|
+
import { betterFetch as betterFetch8 } from "@better-fetch/fetch";
|
|
602
607
|
var twitter = (options) => {
|
|
603
|
-
const twitterArctic = new Twitter(
|
|
604
|
-
options.clientId,
|
|
605
|
-
options.clientSecret,
|
|
606
|
-
getRedirectURI("twitter", options.redirectURI)
|
|
607
|
-
);
|
|
608
608
|
return {
|
|
609
609
|
id: "twitter",
|
|
610
610
|
name: "Twitter",
|
|
611
611
|
createAuthorizationURL(data) {
|
|
612
612
|
const _scopes = options.scope || data.scopes || ["account_info.read"];
|
|
613
|
-
return
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
613
|
+
return createAuthorizationURL({
|
|
614
|
+
id: "twitter",
|
|
615
|
+
options,
|
|
616
|
+
authorizationEndpoint: "https://twitter.com/i/oauth2/authorize",
|
|
617
|
+
scopes: _scopes,
|
|
618
|
+
state: data.state,
|
|
619
|
+
codeVerifier: data.codeVerifier
|
|
620
|
+
});
|
|
618
621
|
},
|
|
619
622
|
validateAuthorizationCode: async (code, codeVerifier, redirectURI) => {
|
|
620
623
|
return validateAuthorizationCode({
|
|
@@ -626,7 +629,7 @@ var twitter = (options) => {
|
|
|
626
629
|
});
|
|
627
630
|
},
|
|
628
631
|
async getUserInfo(token) {
|
|
629
|
-
const { data: profile, error } = await
|
|
632
|
+
const { data: profile, error } = await betterFetch8(
|
|
630
633
|
"https://api.x.com/2/users/me?user.fields=profile_image_url",
|
|
631
634
|
{
|
|
632
635
|
method: "GET",
|
package/dist/solid-start.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as Auth } from './index-
|
|
1
|
+
import { a as Auth } from './index-C-85i2-P.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import 'kysely';
|
|
4
|
-
import './types-
|
|
4
|
+
import './types-DoyeJ_dw.js';
|
|
5
5
|
import 'arctic';
|
|
6
6
|
import './helper-DPDj8Nix.js';
|
|
7
7
|
import 'better-call';
|
package/dist/solid.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import * as _better_fetch_fetch from '@better-fetch/fetch';
|
|
|
3
3
|
import { U as UnionToIntersection, P as Prettify, S as StripEmptyObjects } from './helper-DPDj8Nix.js';
|
|
4
4
|
import { ClientOptions, InferClientAPI, InferActions, InferAdditionalFromClient, BetterAuthClientPlugin, IsSignal } from './types.js';
|
|
5
5
|
import { Accessor } from 'solid-js';
|
|
6
|
-
import './index-
|
|
6
|
+
import './index-C-85i2-P.js';
|
|
7
7
|
import 'kysely';
|
|
8
|
-
import './types-
|
|
8
|
+
import './types-DoyeJ_dw.js';
|
|
9
9
|
import 'arctic';
|
|
10
10
|
import 'better-call';
|
|
11
11
|
import 'better-sqlite3';
|
package/dist/svelte-kit.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as Auth, B as BetterAuthOptions } from './index-
|
|
1
|
+
import { a as Auth, B as BetterAuthOptions } from './index-C-85i2-P.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import 'kysely';
|
|
4
|
-
import './types-
|
|
4
|
+
import './types-DoyeJ_dw.js';
|
|
5
5
|
import 'arctic';
|
|
6
6
|
import './helper-DPDj8Nix.js';
|
|
7
7
|
import 'better-call';
|
package/dist/svelte.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import * as nanostores from 'nanostores';
|
|
|
3
3
|
import * as _better_fetch_fetch from '@better-fetch/fetch';
|
|
4
4
|
import { U as UnionToIntersection, P as Prettify, S as StripEmptyObjects } from './helper-DPDj8Nix.js';
|
|
5
5
|
import { ClientOptions, InferClientAPI, InferActions, InferAdditionalFromClient, BetterAuthClientPlugin, IsSignal } from './types.js';
|
|
6
|
-
import './index-
|
|
6
|
+
import './index-C-85i2-P.js';
|
|
7
7
|
import 'kysely';
|
|
8
|
-
import './types-
|
|
8
|
+
import './types-DoyeJ_dw.js';
|
|
9
9
|
import 'arctic';
|
|
10
10
|
import 'better-call';
|
|
11
11
|
import 'better-sqlite3';
|
|
@@ -272,7 +272,7 @@ interface SpotifyOptions extends ProviderOptions {
|
|
|
272
272
|
declare const spotify: (options: SpotifyOptions) => {
|
|
273
273
|
id: "spotify";
|
|
274
274
|
name: string;
|
|
275
|
-
createAuthorizationURL({ state, scopes }: {
|
|
275
|
+
createAuthorizationURL({ state, scopes, codeVerifier }: {
|
|
276
276
|
state: string;
|
|
277
277
|
codeVerifier: string;
|
|
278
278
|
scopes?: string[];
|
|
@@ -434,7 +434,7 @@ interface GithubOptions extends ProviderOptions {
|
|
|
434
434
|
declare const github: (options: GithubOptions) => {
|
|
435
435
|
id: "github";
|
|
436
436
|
name: string;
|
|
437
|
-
createAuthorizationURL({ state, scopes }: {
|
|
437
|
+
createAuthorizationURL({ state, scopes, codeVerifier }: {
|
|
438
438
|
state: string;
|
|
439
439
|
codeVerifier: string;
|
|
440
440
|
scopes?: string[];
|
|
@@ -472,7 +472,7 @@ interface FacebookOptions extends ProviderOptions {
|
|
|
472
472
|
declare const facebook: (options: FacebookOptions) => {
|
|
473
473
|
id: "facebook";
|
|
474
474
|
name: string;
|
|
475
|
-
createAuthorizationURL({ state, scopes }: {
|
|
475
|
+
createAuthorizationURL({ state, scopes, codeVerifier }: {
|
|
476
476
|
state: string;
|
|
477
477
|
codeVerifier: string;
|
|
478
478
|
scopes?: string[];
|
|
@@ -636,8 +636,8 @@ declare const apple: (options: AppleOptions) => {
|
|
|
636
636
|
scopes?: string[];
|
|
637
637
|
redirectURI?: string;
|
|
638
638
|
}): URL;
|
|
639
|
-
validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<OAuth2Tokens>;
|
|
640
|
-
getUserInfo(token: OAuth2Tokens): Promise<{
|
|
639
|
+
validateAuthorizationCode: (code: string, codeVerifier: string | undefined, redirectURI: string | undefined) => Promise<arctic.OAuth2Tokens>;
|
|
640
|
+
getUserInfo(token: arctic.OAuth2Tokens): Promise<{
|
|
641
641
|
user: {
|
|
642
642
|
id: string;
|
|
643
643
|
name: string;
|
|
@@ -693,7 +693,7 @@ declare const oAuthProviders: {
|
|
|
693
693
|
facebook: (options: FacebookOptions) => {
|
|
694
694
|
id: "facebook";
|
|
695
695
|
name: string;
|
|
696
|
-
createAuthorizationURL({ state, scopes }: {
|
|
696
|
+
createAuthorizationURL({ state, scopes, codeVerifier }: {
|
|
697
697
|
state: string;
|
|
698
698
|
codeVerifier: string;
|
|
699
699
|
scopes?: string[];
|
|
@@ -713,7 +713,7 @@ declare const oAuthProviders: {
|
|
|
713
713
|
github: (options: GithubOptions) => {
|
|
714
714
|
id: "github";
|
|
715
715
|
name: string;
|
|
716
|
-
createAuthorizationURL({ state, scopes }: {
|
|
716
|
+
createAuthorizationURL({ state, scopes, codeVerifier }: {
|
|
717
717
|
state: string;
|
|
718
718
|
codeVerifier: string;
|
|
719
719
|
scopes?: string[];
|
|
@@ -776,7 +776,7 @@ declare const oAuthProviders: {
|
|
|
776
776
|
spotify: (options: SpotifyOptions) => {
|
|
777
777
|
id: "spotify";
|
|
778
778
|
name: string;
|
|
779
|
-
createAuthorizationURL({ state, scopes }: {
|
|
779
|
+
createAuthorizationURL({ state, scopes, codeVerifier }: {
|
|
780
780
|
state: string;
|
|
781
781
|
codeVerifier: string;
|
|
782
782
|
scopes?: string[];
|
package/dist/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { b as BetterAuthPlugin, a as Auth, I as InferFieldsInputClient, h as InferFieldsOutput } from './index-
|
|
2
|
-
export { A as Adapter, k as AdditionalSessionFieldsInput, l as AdditionalSessionFieldsOutput, i as AdditionalUserFieldsInput, j as AdditionalUserFieldsOutput, g as AuthContext, B as BetterAuthOptions, G as GenericEndpointContext, H as HookEndpointContext, p as InferPluginTypes, n as InferSession, m as InferUser, P as PluginSchema, R as RateLimit, S as SecondaryStorage, W as Where, q as init } from './index-
|
|
1
|
+
import { b as BetterAuthPlugin, a as Auth, I as InferFieldsInputClient, h as InferFieldsOutput } from './index-C-85i2-P.js';
|
|
2
|
+
export { A as Adapter, k as AdditionalSessionFieldsInput, l as AdditionalSessionFieldsOutput, i as AdditionalUserFieldsInput, j as AdditionalUserFieldsOutput, g as AuthContext, B as BetterAuthOptions, G as GenericEndpointContext, H as HookEndpointContext, p as InferPluginTypes, n as InferSession, m as InferUser, P as PluginSchema, R as RateLimit, S as SecondaryStorage, W as Where, q as init } from './index-C-85i2-P.js';
|
|
3
3
|
import { U as UnionToIntersection, H as HasRequiredKeys, P as Prettify, S as StripEmptyObjects, L as LiteralString } from './helper-DPDj8Nix.js';
|
|
4
4
|
export { D as DeepPartial, a as LiteralUnion, R as RequiredKeysOf, W as WithoutEmpty } from './helper-DPDj8Nix.js';
|
|
5
|
-
import { S as Session, U as User } from './types-
|
|
6
|
-
export { O as OAuthProvider, b as OAuthProviderList, P as ProviderOptions } from './types-
|
|
5
|
+
import { S as Session, U as User } from './types-DoyeJ_dw.js';
|
|
6
|
+
export { O as OAuthProvider, b as OAuthProviderList, P as ProviderOptions } from './types-DoyeJ_dw.js';
|
|
7
7
|
import { BetterFetchOption, BetterFetchResponse, BetterFetch, BetterFetchPlugin } from '@better-fetch/fetch';
|
|
8
8
|
import { Atom } from 'nanostores';
|
|
9
9
|
import { Endpoint, Context } from 'better-call';
|
package/dist/vue.d.ts
CHANGED
|
@@ -3,9 +3,9 @@ import * as _better_fetch_fetch from '@better-fetch/fetch';
|
|
|
3
3
|
import { U as UnionToIntersection, P as Prettify, S as StripEmptyObjects } from './helper-DPDj8Nix.js';
|
|
4
4
|
import { ClientOptions, InferClientAPI, InferActions, InferAdditionalFromClient, BetterAuthClientPlugin, IsSignal } from './types.js';
|
|
5
5
|
import { Ref, DeepReadonly } from 'vue';
|
|
6
|
-
import './index-
|
|
6
|
+
import './index-C-85i2-P.js';
|
|
7
7
|
import 'kysely';
|
|
8
|
-
import './types-
|
|
8
|
+
import './types-DoyeJ_dw.js';
|
|
9
9
|
import 'arctic';
|
|
10
10
|
import 'better-call';
|
|
11
11
|
import 'better-sqlite3';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "better-auth",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "The most comprehensive authentication library for TypeScript.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -69,7 +69,6 @@
|
|
|
69
69
|
"@babel/preset-react": "^7.24.7",
|
|
70
70
|
"@babel/preset-typescript": "^7.24.7",
|
|
71
71
|
"@better-fetch/fetch": "^1.1.9",
|
|
72
|
-
"@better-fetch/logger": "^1.1.3",
|
|
73
72
|
"@mrleebo/prisma-ast": "^0.12.0",
|
|
74
73
|
"@nanostores/query": "^0.3.4",
|
|
75
74
|
"@nanostores/react": "^0.7.3",
|
|
@@ -77,8 +76,6 @@
|
|
|
77
76
|
"@nanostores/vue": "^0.10.0",
|
|
78
77
|
"@noble/ciphers": "^0.6.0",
|
|
79
78
|
"@noble/hashes": "^1.4.0",
|
|
80
|
-
"@oslojs/encoding": "^1.0.0",
|
|
81
|
-
"@paralleldrive/cuid2": "^2.2.2",
|
|
82
79
|
"@simplewebauthn/browser": "^10.0.0",
|
|
83
80
|
"@simplewebauthn/server": "^10.0.1",
|
|
84
81
|
"arctic": "2.0.0-next.9",
|
|
@@ -88,16 +85,14 @@
|
|
|
88
85
|
"commander": "^12.1.0",
|
|
89
86
|
"consola": "^3.2.3",
|
|
90
87
|
"defu": "^6.1.4",
|
|
91
|
-
"dotenv": "^16.4.5",
|
|
92
|
-
"execa": "^9.4.0",
|
|
93
|
-
"jose": "^5.7.0",
|
|
94
88
|
"kysely": "^0.27.4",
|
|
95
89
|
"nanoid": "^5.0.7",
|
|
96
90
|
"nanoquery": "^1.3.0",
|
|
97
91
|
"nanostores": "^0.11.2",
|
|
98
|
-
"ora": "^8.0.1",
|
|
99
92
|
"oslo": "^1.2.1",
|
|
100
93
|
"prompts": "^2.4.2",
|
|
94
|
+
"tinyexec": "^0.3.0",
|
|
95
|
+
"yocto-spinner": "^0.1.1",
|
|
101
96
|
"zod": "^3.22.5"
|
|
102
97
|
},
|
|
103
98
|
"files": [
|