better-auth 0.4.9-beta.6 → 0.4.9-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.
- package/dist/adapters/drizzle.d.ts +1 -1
- package/dist/adapters/mongodb.d.ts +1 -1
- package/dist/adapters/prisma.d.ts +1 -1
- package/dist/api.d.ts +1 -1
- package/dist/api.js +80 -97
- package/dist/client/plugins.d.ts +3 -3
- package/dist/client.d.ts +1 -1
- package/dist/{index-e3_mbU9X.d.ts → index-D9nYnMiJ.d.ts} +1 -1
- package/dist/{index-DLbRYrL5.d.ts → index-DyhG32S0.d.ts} +24 -24
- package/dist/index.d.ts +1 -1
- package/dist/index.js +91 -122
- package/dist/next-js.d.ts +1 -1
- package/dist/node.d.ts +1 -1
- package/dist/plugins.d.ts +3 -3
- package/dist/plugins.js +85 -102
- package/dist/react.d.ts +1 -1
- package/dist/solid-start.d.ts +1 -1
- package/dist/solid.d.ts +1 -1
- package/dist/svelte-kit.d.ts +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/vue.d.ts +1 -1
- package/package.json +2 -1
package/dist/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { e as AuthEndpoint, f as AuthMiddleware, v as callbackOAuth, T as changePassword, d as createAuthEndpoint, c as createAuthMiddleware, M as createEmailVerificationToken, $ as csrfMiddleware, V as deleteUser, Y as error, J as forgetPassword, K as forgetPasswordCallback, X as getCSRFToken, r as getEndpoints, w as getSession, x as getSessionFromCtx, z as listSessions, Z as ok, o as optionsMiddleware, L as resetPassword, C as revokeSession, D as revokeSessions, s as router, N as sendVerificationEmail, y as sessionMiddleware, U as setPassword, u as signInEmail, t as signInOAuth, E as signOut, _ as signUpEmail, Q as updateUser, O as verifyEmail } from './index-
|
|
1
|
+
export { e as AuthEndpoint, f as AuthMiddleware, v as callbackOAuth, T as changePassword, d as createAuthEndpoint, c as createAuthMiddleware, M as createEmailVerificationToken, $ as csrfMiddleware, V as deleteUser, Y as error, J as forgetPassword, K as forgetPasswordCallback, X as getCSRFToken, r as getEndpoints, w as getSession, x as getSessionFromCtx, z as listSessions, Z as ok, o as optionsMiddleware, L as resetPassword, C as revokeSession, D as revokeSessions, s as router, N as sendVerificationEmail, y as sessionMiddleware, U as setPassword, u as signInEmail, t as signInOAuth, E as signOut, _ as signUpEmail, Q as updateUser, O as verifyEmail } from './index-DyhG32S0.js';
|
|
2
2
|
import './helper-DPDj8Nix.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
export { APIError } from 'better-call';
|
package/dist/api.js
CHANGED
|
@@ -1074,39 +1074,39 @@ var signInOAuth = createAuthEndpoint(
|
|
|
1074
1074
|
}),
|
|
1075
1075
|
use: [redirectURLMiddleware]
|
|
1076
1076
|
},
|
|
1077
|
-
async (
|
|
1078
|
-
const provider =
|
|
1079
|
-
(p) => p.id ===
|
|
1077
|
+
async (c) => {
|
|
1078
|
+
const provider = c.context.socialProviders.find(
|
|
1079
|
+
(p) => p.id === c.body.provider
|
|
1080
1080
|
);
|
|
1081
1081
|
if (!provider) {
|
|
1082
|
-
|
|
1082
|
+
c.context.logger.error(
|
|
1083
1083
|
"Provider not found. Make sure to add the provider to your auth config",
|
|
1084
1084
|
{
|
|
1085
|
-
provider:
|
|
1085
|
+
provider: c.body.provider
|
|
1086
1086
|
}
|
|
1087
1087
|
);
|
|
1088
1088
|
throw new APIError5("NOT_FOUND", {
|
|
1089
1089
|
message: "Provider not found"
|
|
1090
1090
|
});
|
|
1091
1091
|
}
|
|
1092
|
-
const cookie =
|
|
1093
|
-
const currentURL =
|
|
1094
|
-
const callbackURL =
|
|
1092
|
+
const cookie = c.context.authCookies;
|
|
1093
|
+
const currentURL = c.query?.currentURL ? new URL(c.query?.currentURL) : null;
|
|
1094
|
+
const callbackURL = c.body.callbackURL?.startsWith("http") ? c.body.callbackURL : `${currentURL?.origin}${c.body.callbackURL || ""}`;
|
|
1095
1095
|
const state = generateState(
|
|
1096
|
-
callbackURL || currentURL?.origin ||
|
|
1097
|
-
|
|
1096
|
+
callbackURL || currentURL?.origin || c.context.baseURL,
|
|
1097
|
+
c.query?.currentURL
|
|
1098
1098
|
);
|
|
1099
|
-
await
|
|
1099
|
+
await c.setSignedCookie(
|
|
1100
1100
|
cookie.state.name,
|
|
1101
1101
|
state,
|
|
1102
|
-
|
|
1102
|
+
c.context.secret,
|
|
1103
1103
|
cookie.state.options
|
|
1104
1104
|
);
|
|
1105
1105
|
const codeVerifier = generateCodeVerifier();
|
|
1106
|
-
await
|
|
1106
|
+
await c.setSignedCookie(
|
|
1107
1107
|
cookie.pkCodeVerifier.name,
|
|
1108
1108
|
codeVerifier,
|
|
1109
|
-
|
|
1109
|
+
c.context.secret,
|
|
1110
1110
|
cookie.pkCodeVerifier.options
|
|
1111
1111
|
);
|
|
1112
1112
|
const url = await provider.createAuthorizationURL({
|
|
@@ -1115,9 +1115,9 @@ var signInOAuth = createAuthEndpoint(
|
|
|
1115
1115
|
});
|
|
1116
1116
|
url.searchParams.set(
|
|
1117
1117
|
"redirect_uri",
|
|
1118
|
-
`${
|
|
1118
|
+
`${c.context.baseURL}/callback/${c.body.provider}`
|
|
1119
1119
|
);
|
|
1120
|
-
return
|
|
1120
|
+
return c.json({
|
|
1121
1121
|
url: url.toString(),
|
|
1122
1122
|
state,
|
|
1123
1123
|
codeVerifier,
|
|
@@ -1150,12 +1150,6 @@ var signInEmail = createAuthEndpoint(
|
|
|
1150
1150
|
message: "Email and password is not enabled"
|
|
1151
1151
|
});
|
|
1152
1152
|
}
|
|
1153
|
-
const currentSession = await getSessionFromCtx(ctx);
|
|
1154
|
-
if (currentSession) {
|
|
1155
|
-
await ctx.context.internalAdapter.deleteSession(
|
|
1156
|
-
currentSession.session.id
|
|
1157
|
-
);
|
|
1158
|
-
}
|
|
1159
1153
|
const { email, password } = ctx.body;
|
|
1160
1154
|
const checkEmail = z4.string().email().safeParse(email);
|
|
1161
1155
|
if (!checkEmail.success) {
|
|
@@ -1219,17 +1213,6 @@ var signInEmail = createAuthEndpoint(
|
|
|
1219
1213
|
});
|
|
1220
1214
|
}
|
|
1221
1215
|
);
|
|
1222
|
-
var c = (o) => {
|
|
1223
|
-
};
|
|
1224
|
-
c({
|
|
1225
|
-
additional: {
|
|
1226
|
-
name: "string"
|
|
1227
|
-
},
|
|
1228
|
-
hooks: {
|
|
1229
|
-
create(user) {
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
});
|
|
1233
1216
|
|
|
1234
1217
|
// src/api/routes/callback.ts
|
|
1235
1218
|
import { APIError as APIError6 } from "better-call";
|
|
@@ -1400,63 +1383,63 @@ var callbackOAuth = createAuthEndpoint(
|
|
|
1400
1383
|
}),
|
|
1401
1384
|
metadata: HIDE_METADATA
|
|
1402
1385
|
},
|
|
1403
|
-
async (
|
|
1404
|
-
if (
|
|
1405
|
-
const parsedState2 = parseState(
|
|
1406
|
-
const callbackURL2 = parsedState2.data?.callbackURL || `${
|
|
1407
|
-
|
|
1408
|
-
throw
|
|
1409
|
-
`${callbackURL2}?error=${
|
|
1386
|
+
async (c) => {
|
|
1387
|
+
if (c.query.error || !c.query.code) {
|
|
1388
|
+
const parsedState2 = parseState(c.query.state);
|
|
1389
|
+
const callbackURL2 = parsedState2.data?.callbackURL || `${c.context.baseURL}/error`;
|
|
1390
|
+
c.context.logger.error(c.query.error, c.params.id);
|
|
1391
|
+
throw c.redirect(
|
|
1392
|
+
`${callbackURL2}?error=${c.query.error || "oAuth_code_missing"}`
|
|
1410
1393
|
);
|
|
1411
1394
|
}
|
|
1412
|
-
const provider =
|
|
1413
|
-
(p) => p.id ===
|
|
1395
|
+
const provider = c.context.socialProviders.find(
|
|
1396
|
+
(p) => p.id === c.params.id
|
|
1414
1397
|
);
|
|
1415
1398
|
if (!provider) {
|
|
1416
|
-
|
|
1399
|
+
c.context.logger.error(
|
|
1417
1400
|
"Oauth provider with id",
|
|
1418
|
-
|
|
1401
|
+
c.params.id,
|
|
1419
1402
|
"not found"
|
|
1420
1403
|
);
|
|
1421
|
-
throw
|
|
1422
|
-
`${
|
|
1404
|
+
throw c.redirect(
|
|
1405
|
+
`${c.context.baseURL}/error?error=oauth_provider_not_found`
|
|
1423
1406
|
);
|
|
1424
1407
|
}
|
|
1425
|
-
const parsedState = parseState(
|
|
1408
|
+
const parsedState = parseState(c.query.state);
|
|
1426
1409
|
if (!parsedState.success) {
|
|
1427
|
-
|
|
1428
|
-
throw
|
|
1429
|
-
`${
|
|
1410
|
+
c.context.logger.error("Unable to parse state");
|
|
1411
|
+
throw c.redirect(
|
|
1412
|
+
`${c.context.baseURL}/error?error=please_restart_the_process`
|
|
1430
1413
|
);
|
|
1431
1414
|
}
|
|
1432
1415
|
const {
|
|
1433
1416
|
data: { callbackURL, currentURL }
|
|
1434
1417
|
} = parsedState;
|
|
1435
|
-
const storedState = await
|
|
1436
|
-
|
|
1437
|
-
|
|
1418
|
+
const storedState = await c.getSignedCookie(
|
|
1419
|
+
c.context.authCookies.state.name,
|
|
1420
|
+
c.context.secret
|
|
1438
1421
|
);
|
|
1439
|
-
if (storedState !==
|
|
1422
|
+
if (storedState !== c.query.state) {
|
|
1440
1423
|
logger.error("OAuth state mismatch");
|
|
1441
|
-
throw
|
|
1442
|
-
`${
|
|
1424
|
+
throw c.redirect(
|
|
1425
|
+
`${c.context.baseURL}/error?error=please_restart_the_process`
|
|
1443
1426
|
);
|
|
1444
1427
|
}
|
|
1445
|
-
const codeVerifier = await
|
|
1446
|
-
|
|
1447
|
-
|
|
1428
|
+
const codeVerifier = await c.getSignedCookie(
|
|
1429
|
+
c.context.authCookies.pkCodeVerifier.name,
|
|
1430
|
+
c.context.secret
|
|
1448
1431
|
);
|
|
1449
1432
|
let tokens;
|
|
1450
1433
|
try {
|
|
1451
1434
|
tokens = await provider.validateAuthorizationCode(
|
|
1452
|
-
|
|
1435
|
+
c.query.code,
|
|
1453
1436
|
codeVerifier,
|
|
1454
|
-
`${
|
|
1437
|
+
`${c.context.baseURL}/callback/${provider.id}`
|
|
1455
1438
|
);
|
|
1456
1439
|
} catch (e) {
|
|
1457
|
-
|
|
1458
|
-
throw
|
|
1459
|
-
`${
|
|
1440
|
+
c.context.logger.error(e);
|
|
1441
|
+
throw c.redirect(
|
|
1442
|
+
`${c.context.baseURL}/error?error=please_restart_the_process`
|
|
1460
1443
|
);
|
|
1461
1444
|
}
|
|
1462
1445
|
const user = await provider.getUserInfo(tokens).then((res) => res?.user);
|
|
@@ -1467,24 +1450,24 @@ var callbackOAuth = createAuthEndpoint(
|
|
|
1467
1450
|
});
|
|
1468
1451
|
if (!user || data.success === false) {
|
|
1469
1452
|
logger.error("Unable to get user info", data.error);
|
|
1470
|
-
throw
|
|
1471
|
-
`${
|
|
1453
|
+
throw c.redirect(
|
|
1454
|
+
`${c.context.baseURL}/error?error=please_restart_the_process`
|
|
1472
1455
|
);
|
|
1473
1456
|
}
|
|
1474
1457
|
if (!callbackURL) {
|
|
1475
|
-
throw
|
|
1476
|
-
`${
|
|
1458
|
+
throw c.redirect(
|
|
1459
|
+
`${c.context.baseURL}/error?error=please_restart_the_process`
|
|
1477
1460
|
);
|
|
1478
1461
|
}
|
|
1479
|
-
const dbUser = await
|
|
1462
|
+
const dbUser = await c.context.internalAdapter.findUserByEmail(user.email, {
|
|
1480
1463
|
includeAccounts: true
|
|
1481
1464
|
}).catch((e) => {
|
|
1482
1465
|
logger.error(
|
|
1483
1466
|
"Better auth was unable to query your database.\nError: ",
|
|
1484
1467
|
e
|
|
1485
1468
|
);
|
|
1486
|
-
throw
|
|
1487
|
-
`${
|
|
1469
|
+
throw c.redirect(
|
|
1470
|
+
`${c.context.baseURL}/error?error=internal_server_error`
|
|
1488
1471
|
);
|
|
1489
1472
|
});
|
|
1490
1473
|
const userId = dbUser?.user.id;
|
|
@@ -1492,7 +1475,7 @@ var callbackOAuth = createAuthEndpoint(
|
|
|
1492
1475
|
const hasBeenLinked = dbUser.accounts.find(
|
|
1493
1476
|
(a) => a.providerId === provider.id
|
|
1494
1477
|
);
|
|
1495
|
-
const trustedProviders =
|
|
1478
|
+
const trustedProviders = c.context.options.account?.accountLinking?.trustedProviders;
|
|
1496
1479
|
const isTrustedProvider = trustedProviders ? trustedProviders.includes(provider.id) : true;
|
|
1497
1480
|
if (!hasBeenLinked && (!user.emailVerified || !isTrustedProvider)) {
|
|
1498
1481
|
let url;
|
|
@@ -1500,15 +1483,15 @@ var callbackOAuth = createAuthEndpoint(
|
|
|
1500
1483
|
url = new URL(currentURL || callbackURL);
|
|
1501
1484
|
url.searchParams.set("error", "account_not_linked");
|
|
1502
1485
|
} catch (e) {
|
|
1503
|
-
throw
|
|
1504
|
-
`${
|
|
1486
|
+
throw c.redirect(
|
|
1487
|
+
`${c.context.baseURL}/error?error=account_not_linked`
|
|
1505
1488
|
);
|
|
1506
1489
|
}
|
|
1507
|
-
throw
|
|
1490
|
+
throw c.redirect(url.toString());
|
|
1508
1491
|
}
|
|
1509
1492
|
if (!hasBeenLinked) {
|
|
1510
1493
|
try {
|
|
1511
|
-
await
|
|
1494
|
+
await c.context.internalAdapter.linkAccount({
|
|
1512
1495
|
providerId: provider.id,
|
|
1513
1496
|
accountId: user.id.toString(),
|
|
1514
1497
|
id: `${provider.id}:${user.id}`,
|
|
@@ -1517,14 +1500,14 @@ var callbackOAuth = createAuthEndpoint(
|
|
|
1517
1500
|
});
|
|
1518
1501
|
} catch (e) {
|
|
1519
1502
|
console.log(e);
|
|
1520
|
-
throw
|
|
1521
|
-
`${
|
|
1503
|
+
throw c.redirect(
|
|
1504
|
+
`${c.context.baseURL}/error?error=failed_linking_account`
|
|
1522
1505
|
);
|
|
1523
1506
|
}
|
|
1524
1507
|
}
|
|
1525
1508
|
} else {
|
|
1526
1509
|
try {
|
|
1527
|
-
await
|
|
1510
|
+
await c.context.internalAdapter.createOAuthUser(data.data, {
|
|
1528
1511
|
...getAccountTokens(tokens),
|
|
1529
1512
|
id: `${provider.id}:${user.id}`,
|
|
1530
1513
|
providerId: provider.id,
|
|
@@ -1534,8 +1517,8 @@ var callbackOAuth = createAuthEndpoint(
|
|
|
1534
1517
|
} catch (e) {
|
|
1535
1518
|
const url = new URL(currentURL || callbackURL);
|
|
1536
1519
|
url.searchParams.set("error", "unable_to_create_user");
|
|
1537
|
-
|
|
1538
|
-
throw
|
|
1520
|
+
c.setHeader("Location", url.toString());
|
|
1521
|
+
throw c.redirect(url.toString());
|
|
1539
1522
|
}
|
|
1540
1523
|
}
|
|
1541
1524
|
if (!userId && !id)
|
|
@@ -1543,29 +1526,29 @@ var callbackOAuth = createAuthEndpoint(
|
|
|
1543
1526
|
message: "Unable to create user"
|
|
1544
1527
|
});
|
|
1545
1528
|
try {
|
|
1546
|
-
const session = await
|
|
1529
|
+
const session = await c.context.internalAdapter.createSession(
|
|
1547
1530
|
userId || id,
|
|
1548
|
-
|
|
1531
|
+
c.request
|
|
1549
1532
|
);
|
|
1550
1533
|
if (!session) {
|
|
1551
1534
|
const url = new URL(currentURL || callbackURL);
|
|
1552
1535
|
url.searchParams.set("error", "unable_to_create_session");
|
|
1553
|
-
throw
|
|
1536
|
+
throw c.redirect(url.toString());
|
|
1554
1537
|
}
|
|
1555
1538
|
try {
|
|
1556
|
-
await setSessionCookie(
|
|
1539
|
+
await setSessionCookie(c, session.id);
|
|
1557
1540
|
} catch (e) {
|
|
1558
|
-
|
|
1541
|
+
c.context.logger.error("Unable to set session cookie", e);
|
|
1559
1542
|
const url = new URL(currentURL || callbackURL);
|
|
1560
1543
|
url.searchParams.set("error", "unable_to_create_session");
|
|
1561
|
-
throw
|
|
1544
|
+
throw c.redirect(url.toString());
|
|
1562
1545
|
}
|
|
1563
1546
|
} catch {
|
|
1564
1547
|
const url = new URL(currentURL || callbackURL || "");
|
|
1565
1548
|
url.searchParams.set("error", "unable_to_create_session");
|
|
1566
|
-
throw
|
|
1549
|
+
throw c.redirect(url.toString());
|
|
1567
1550
|
}
|
|
1568
|
-
throw
|
|
1551
|
+
throw c.redirect(callbackURL);
|
|
1569
1552
|
}
|
|
1570
1553
|
);
|
|
1571
1554
|
|
|
@@ -2222,8 +2205,8 @@ var error = createAuthEndpoint(
|
|
|
2222
2205
|
method: "GET",
|
|
2223
2206
|
metadata: HIDE_METADATA
|
|
2224
2207
|
},
|
|
2225
|
-
async (
|
|
2226
|
-
const query = new URL(
|
|
2208
|
+
async (c) => {
|
|
2209
|
+
const query = new URL(c.request?.url || "").searchParams.get("error") || "Unknown";
|
|
2227
2210
|
return new Response(html(query), {
|
|
2228
2211
|
headers: {
|
|
2229
2212
|
"Content-Type": "text/html"
|
|
@@ -2617,26 +2600,26 @@ function getEndpoints(ctx, options) {
|
|
|
2617
2600
|
let api = {};
|
|
2618
2601
|
for (const [key, value] of Object.entries(endpoints)) {
|
|
2619
2602
|
api[key] = async (context) => {
|
|
2620
|
-
let
|
|
2603
|
+
let c = await ctx;
|
|
2621
2604
|
for (const plugin of options.plugins || []) {
|
|
2622
2605
|
if (plugin.hooks?.before) {
|
|
2623
2606
|
for (const hook of plugin.hooks.before) {
|
|
2624
2607
|
const match = hook.matcher({
|
|
2625
2608
|
...value,
|
|
2626
2609
|
...context,
|
|
2627
|
-
context:
|
|
2610
|
+
context: c
|
|
2628
2611
|
});
|
|
2629
2612
|
if (match) {
|
|
2630
2613
|
const hookRes = await hook.handler({
|
|
2631
2614
|
...context,
|
|
2632
2615
|
context: {
|
|
2633
|
-
...
|
|
2616
|
+
...c,
|
|
2634
2617
|
...context.context
|
|
2635
2618
|
}
|
|
2636
2619
|
});
|
|
2637
2620
|
if (hookRes && "context" in hookRes) {
|
|
2638
|
-
|
|
2639
|
-
...
|
|
2621
|
+
c = {
|
|
2622
|
+
...c,
|
|
2640
2623
|
...hookRes.context
|
|
2641
2624
|
};
|
|
2642
2625
|
}
|
|
@@ -2647,7 +2630,7 @@ function getEndpoints(ctx, options) {
|
|
|
2647
2630
|
const endpointRes = await value({
|
|
2648
2631
|
...context,
|
|
2649
2632
|
context: {
|
|
2650
|
-
...
|
|
2633
|
+
...c,
|
|
2651
2634
|
...context.context
|
|
2652
2635
|
}
|
|
2653
2636
|
});
|
package/dist/client/plugins.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ import * as nanostores from 'nanostores';
|
|
|
2
2
|
import { A as AccessControl, S as StatementsPrimitive, R as Role } from '../statement-CfnyN34h.js';
|
|
3
3
|
import * as _better_fetch_fetch from '@better-fetch/fetch';
|
|
4
4
|
import { BetterFetchOption } from '@better-fetch/fetch';
|
|
5
|
-
import { o as organization, k as Organization, M as Member, I as Invitation, u as username, m as magicLink, d as phoneNumber, e as anonymous, i as admin, j as genericOAuth } from '../index-
|
|
6
|
-
export { g as getPasskeyActions, c as passkeyClient, a as twoFactorClient } from '../index-
|
|
5
|
+
import { o as organization, k as Organization, M as Member, I as Invitation, u as username, m as magicLink, d as phoneNumber, e as anonymous, i as admin, j as genericOAuth } from '../index-D9nYnMiJ.js';
|
|
6
|
+
export { g as getPasskeyActions, c as passkeyClient, a as twoFactorClient } from '../index-D9nYnMiJ.js';
|
|
7
7
|
import { P as Prettify } from '../helper-DPDj8Nix.js';
|
|
8
|
-
import { F as FieldAttribute, B as BetterAuthOptions, b as BetterAuthPlugin } from '../index-
|
|
8
|
+
import { F as FieldAttribute, B as BetterAuthOptions, b as BetterAuthPlugin } from '../index-DyhG32S0.js';
|
|
9
9
|
import '../types-IzAbV4nB.js';
|
|
10
10
|
import 'zod';
|
|
11
11
|
import 'better-call';
|
package/dist/client.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { BetterFetch, BetterFetchError, BetterFetchOption } from '@better-fetch/
|
|
|
6
6
|
import { U as UnionToIntersection, P as Prettify, S as StripEmptyObjects } from './helper-DPDj8Nix.js';
|
|
7
7
|
import { ClientOptions, InferClientAPI, InferActions, InferAdditionalFromClient, InferSessionFromClient, InferUserFromClient, BetterAuthClientPlugin, IsSignal } from './types.js';
|
|
8
8
|
export { AtomListener, InferPluginsFromClient } from './types.js';
|
|
9
|
-
import './index-
|
|
9
|
+
import './index-DyhG32S0.js';
|
|
10
10
|
import 'kysely';
|
|
11
11
|
import './types-IzAbV4nB.js';
|
|
12
12
|
import 'better-call';
|
|
@@ -5,7 +5,7 @@ import { P as Prettify } from './helper-DPDj8Nix.js';
|
|
|
5
5
|
import { A as AccessControl, R as Role, S as StatementsPrimitive, g as defaultRoles } from './statement-CfnyN34h.js';
|
|
6
6
|
import * as _better_fetch_fetch from '@better-fetch/fetch';
|
|
7
7
|
import { BetterFetch, BetterFetchOption } from '@better-fetch/fetch';
|
|
8
|
-
import { H as HookEndpointContext, g as AuthContext } from './index-
|
|
8
|
+
import { H as HookEndpointContext, g as AuthContext } from './index-DyhG32S0.js';
|
|
9
9
|
import * as nanostores from 'nanostores';
|
|
10
10
|
import { atom } from 'nanostores';
|
|
11
11
|
import * as _simplewebauthn_types from '@simplewebauthn/types';
|
|
@@ -1120,12 +1120,12 @@ declare const signInOAuth: {
|
|
|
1120
1120
|
/**
|
|
1121
1121
|
* OAuth2 provider to use`
|
|
1122
1122
|
*/
|
|
1123
|
-
provider: z.ZodEnum<["github", ...("
|
|
1123
|
+
provider: z.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
1124
1124
|
}, "strip", z.ZodTypeAny, {
|
|
1125
|
-
provider: "
|
|
1125
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
1126
1126
|
callbackURL?: string | undefined;
|
|
1127
1127
|
}, {
|
|
1128
|
-
provider: "
|
|
1128
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
1129
1129
|
callbackURL?: string | undefined;
|
|
1130
1130
|
}>;
|
|
1131
1131
|
use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
|
|
@@ -1160,12 +1160,12 @@ declare const signInOAuth: {
|
|
|
1160
1160
|
/**
|
|
1161
1161
|
* OAuth2 provider to use`
|
|
1162
1162
|
*/
|
|
1163
|
-
provider: z.ZodEnum<["github", ...("
|
|
1163
|
+
provider: z.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
1164
1164
|
}, "strip", z.ZodTypeAny, {
|
|
1165
|
-
provider: "
|
|
1165
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
1166
1166
|
callbackURL?: string | undefined;
|
|
1167
1167
|
}, {
|
|
1168
|
-
provider: "
|
|
1168
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
1169
1169
|
callbackURL?: string | undefined;
|
|
1170
1170
|
}>;
|
|
1171
1171
|
use: better_call.Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
|
|
@@ -2361,12 +2361,12 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
|
|
|
2361
2361
|
}>>;
|
|
2362
2362
|
body: zod.ZodObject<{
|
|
2363
2363
|
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
2364
|
-
provider: zod.ZodEnum<["github", ...("
|
|
2364
|
+
provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
2365
2365
|
}, "strip", zod.ZodTypeAny, {
|
|
2366
|
-
provider: "
|
|
2366
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
2367
2367
|
callbackURL?: string | undefined;
|
|
2368
2368
|
}, {
|
|
2369
|
-
provider: "
|
|
2369
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
2370
2370
|
callbackURL?: string | undefined;
|
|
2371
2371
|
}>;
|
|
2372
2372
|
use: Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
|
|
@@ -2391,12 +2391,12 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
|
|
|
2391
2391
|
}>>;
|
|
2392
2392
|
body: zod.ZodObject<{
|
|
2393
2393
|
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
2394
|
-
provider: zod.ZodEnum<["github", ...("
|
|
2394
|
+
provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
2395
2395
|
}, "strip", zod.ZodTypeAny, {
|
|
2396
|
-
provider: "
|
|
2396
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
2397
2397
|
callbackURL?: string | undefined;
|
|
2398
2398
|
}, {
|
|
2399
|
-
provider: "
|
|
2399
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
2400
2400
|
callbackURL?: string | undefined;
|
|
2401
2401
|
}>;
|
|
2402
2402
|
use: Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
|
|
@@ -3450,12 +3450,12 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
|
|
|
3450
3450
|
}>>;
|
|
3451
3451
|
body: zod.ZodObject<{
|
|
3452
3452
|
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
3453
|
-
provider: zod.ZodEnum<["github", ...("
|
|
3453
|
+
provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
3454
3454
|
}, "strip", zod.ZodTypeAny, {
|
|
3455
|
-
provider: "
|
|
3455
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
3456
3456
|
callbackURL?: string | undefined;
|
|
3457
3457
|
}, {
|
|
3458
|
-
provider: "
|
|
3458
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
3459
3459
|
callbackURL?: string | undefined;
|
|
3460
3460
|
}>;
|
|
3461
3461
|
use: Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
|
|
@@ -3480,12 +3480,12 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
|
|
|
3480
3480
|
}>>;
|
|
3481
3481
|
body: zod.ZodObject<{
|
|
3482
3482
|
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
3483
|
-
provider: zod.ZodEnum<["github", ...("
|
|
3483
|
+
provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
3484
3484
|
}, "strip", zod.ZodTypeAny, {
|
|
3485
|
-
provider: "
|
|
3485
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
3486
3486
|
callbackURL?: string | undefined;
|
|
3487
3487
|
}, {
|
|
3488
|
-
provider: "
|
|
3488
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
3489
3489
|
callbackURL?: string | undefined;
|
|
3490
3490
|
}>;
|
|
3491
3491
|
use: Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
|
|
@@ -4541,12 +4541,12 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
|
|
|
4541
4541
|
}>>;
|
|
4542
4542
|
body: zod.ZodObject<{
|
|
4543
4543
|
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
4544
|
-
provider: zod.ZodEnum<["github", ...("
|
|
4544
|
+
provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
4545
4545
|
}, "strip", zod.ZodTypeAny, {
|
|
4546
|
-
provider: "
|
|
4546
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
4547
4547
|
callbackURL?: string | undefined;
|
|
4548
4548
|
}, {
|
|
4549
|
-
provider: "
|
|
4549
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
4550
4550
|
callbackURL?: string | undefined;
|
|
4551
4551
|
}>;
|
|
4552
4552
|
use: Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
|
|
@@ -4571,12 +4571,12 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
|
|
|
4571
4571
|
}>>;
|
|
4572
4572
|
body: zod.ZodObject<{
|
|
4573
4573
|
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
4574
|
-
provider: zod.ZodEnum<["github", ...("
|
|
4574
|
+
provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
4575
4575
|
}, "strip", zod.ZodTypeAny, {
|
|
4576
|
-
provider: "
|
|
4576
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
4577
4577
|
callbackURL?: string | undefined;
|
|
4578
4578
|
}, {
|
|
4579
|
-
provider: "
|
|
4579
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
4580
4580
|
callbackURL?: string | undefined;
|
|
4581
4581
|
}>;
|
|
4582
4582
|
use: Endpoint<better_call.Handler<string, better_call.EndpointOptions, void>, better_call.EndpointOptions>[];
|
package/dist/index.d.ts
CHANGED