better-auth 0.4.2 → 0.4.3
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 -3
- package/dist/adapters/mongodb.d.ts +2 -3
- package/dist/adapters/prisma.d.ts +2 -3
- package/dist/api.d.ts +2 -3
- package/dist/api.js +43 -29
- package/dist/cli.js +1 -2
- package/dist/client/plugins.d.ts +4 -5
- package/dist/client.d.ts +2 -3
- package/dist/{index-BOgQnoz7.d.ts → index-BJjwxSm5.d.ts} +2 -2
- package/dist/{index-C-85i2-P.d.ts → index-DTlKO6LZ.d.ts} +25 -25
- package/dist/index.d.ts +2 -3
- package/dist/index.js +43 -29
- package/dist/next-js.d.ts +2 -3
- package/dist/node.d.ts +2 -3
- package/dist/plugins.d.ts +4 -5
- package/dist/plugins.js +63 -44
- package/dist/react.d.ts +2 -3
- package/dist/social.d.ts +1 -2
- package/dist/social.js +38 -24
- package/dist/solid-start.d.ts +2 -3
- package/dist/solid.d.ts +2 -3
- package/dist/svelte-kit.d.ts +2 -3
- package/dist/svelte.d.ts +2 -3
- package/dist/{types-DoyeJ_dw.d.ts → types-IzAbV4nB.d.ts} +63 -56
- package/dist/types.d.ts +4 -5
- package/dist/vue.d.ts +2 -3
- package/package.json +2 -6
package/dist/.DS_Store
CHANGED
|
Binary file
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { A as Adapter } from '../index-
|
|
1
|
+
import { A as Adapter } from '../index-DTlKO6LZ.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import 'kysely';
|
|
4
|
-
import '../types-
|
|
5
|
-
import 'arctic';
|
|
4
|
+
import '../types-IzAbV4nB.js';
|
|
6
5
|
import '../helper-DPDj8Nix.js';
|
|
7
6
|
import 'better-call';
|
|
8
7
|
import 'better-sqlite3';
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Db } from 'mongodb';
|
|
2
|
-
import { W as Where } from '../index-
|
|
2
|
+
import { W as Where } from '../index-DTlKO6LZ.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
import 'kysely';
|
|
5
|
-
import '../types-
|
|
6
|
-
import 'arctic';
|
|
5
|
+
import '../types-IzAbV4nB.js';
|
|
7
6
|
import '../helper-DPDj8Nix.js';
|
|
8
7
|
import 'better-call';
|
|
9
8
|
import 'better-sqlite3';
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { A as Adapter } from '../index-
|
|
1
|
+
import { A as Adapter } from '../index-DTlKO6LZ.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import 'kysely';
|
|
4
|
-
import '../types-
|
|
5
|
-
import 'arctic';
|
|
4
|
+
import '../types-IzAbV4nB.js';
|
|
6
5
|
import '../helper-DPDj8Nix.js';
|
|
7
6
|
import 'better-call';
|
|
8
7
|
import 'better-sqlite3';
|
package/dist/api.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
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-DTlKO6LZ.js';
|
|
2
2
|
import './helper-DPDj8Nix.js';
|
|
3
3
|
import 'zod';
|
|
4
4
|
export { APIError } from 'better-call';
|
|
5
5
|
import 'kysely';
|
|
6
|
-
import './types-
|
|
7
|
-
import 'arctic';
|
|
6
|
+
import './types-IzAbV4nB.js';
|
|
8
7
|
import 'better-sqlite3';
|
|
9
8
|
import 'mysql2';
|
package/dist/api.js
CHANGED
|
@@ -9,7 +9,7 @@ import { z } from "zod";
|
|
|
9
9
|
import { xchacha20poly1305 } from "@noble/ciphers/chacha";
|
|
10
10
|
import { bytesToHex, hexToBytes, utf8ToBytes } from "@noble/ciphers/utils";
|
|
11
11
|
import { managedNonce } from "@noble/ciphers/webcrypto";
|
|
12
|
-
import { sha256 } from "
|
|
12
|
+
import { sha256 } from "oslo/crypto";
|
|
13
13
|
async function hs256(secretKey, message) {
|
|
14
14
|
const enc = new TextEncoder();
|
|
15
15
|
const algorithm = { name: "HMAC", hash: "SHA-256" };
|
|
@@ -107,7 +107,7 @@ import { z as z4 } from "zod";
|
|
|
107
107
|
import { parseJWT } from "oslo/jwt";
|
|
108
108
|
|
|
109
109
|
// src/social-providers/utils.ts
|
|
110
|
-
import {
|
|
110
|
+
import { sha256 as sha2562 } from "oslo/crypto";
|
|
111
111
|
|
|
112
112
|
// src/error/better-auth-error.ts
|
|
113
113
|
var BetterAuthError = class extends Error {
|
|
@@ -156,7 +156,6 @@ function getBaseURL(url, path) {
|
|
|
156
156
|
|
|
157
157
|
// src/social-providers/utils.ts
|
|
158
158
|
import { betterFetch } from "@better-fetch/fetch";
|
|
159
|
-
import { sha256 as sha2562 } from "@noble/hashes/sha256";
|
|
160
159
|
import { base64url } from "oslo/encoding";
|
|
161
160
|
function getRedirectURI(providerId, redirectURI) {
|
|
162
161
|
return redirectURI || `${getBaseURL()}/callback/${providerId}`;
|
|
@@ -187,16 +186,18 @@ async function validateAuthorizationCode({
|
|
|
187
186
|
if (error2) {
|
|
188
187
|
throw error2;
|
|
189
188
|
}
|
|
190
|
-
const tokens =
|
|
189
|
+
const tokens = getOAuth2Tokens(data);
|
|
191
190
|
return tokens;
|
|
192
191
|
}
|
|
193
|
-
function generateCodeChallenge(codeVerifier) {
|
|
194
|
-
const codeChallengeBytes = sha2562(
|
|
195
|
-
|
|
192
|
+
async function generateCodeChallenge(codeVerifier) {
|
|
193
|
+
const codeChallengeBytes = await sha2562(
|
|
194
|
+
new TextEncoder().encode(codeVerifier)
|
|
195
|
+
);
|
|
196
|
+
return base64url.encode(new Uint8Array(codeChallengeBytes), {
|
|
196
197
|
includePadding: false
|
|
197
198
|
});
|
|
198
199
|
}
|
|
199
|
-
function createAuthorizationURL({
|
|
200
|
+
async function createAuthorizationURL({
|
|
200
201
|
id,
|
|
201
202
|
options,
|
|
202
203
|
authorizationEndpoint,
|
|
@@ -215,12 +216,22 @@ function createAuthorizationURL({
|
|
|
215
216
|
options.redirectURI || getRedirectURI(id)
|
|
216
217
|
);
|
|
217
218
|
if (!disablePkce && codeVerifier) {
|
|
218
|
-
const codeChallenge = generateCodeChallenge(codeVerifier);
|
|
219
|
+
const codeChallenge = await generateCodeChallenge(codeVerifier);
|
|
219
220
|
url.searchParams.set("code_challenge_method", "S256");
|
|
220
221
|
url.searchParams.set("code_challenge", codeChallenge);
|
|
221
222
|
}
|
|
222
223
|
return url;
|
|
223
224
|
}
|
|
225
|
+
function getOAuth2Tokens(data) {
|
|
226
|
+
return {
|
|
227
|
+
tokenType: data.token_type,
|
|
228
|
+
accessToken: data.access_token,
|
|
229
|
+
refreshToken: data.refresh_token,
|
|
230
|
+
accessTokenExpiresAt: data.expires_at ? new Date((Date.now() + data.expires_in) * 1e3) : void 0,
|
|
231
|
+
scopes: data.scope?.split(" ") || [],
|
|
232
|
+
idToken: data.id_token
|
|
233
|
+
};
|
|
234
|
+
}
|
|
224
235
|
|
|
225
236
|
// src/social-providers/apple.ts
|
|
226
237
|
var apple = (options) => {
|
|
@@ -244,7 +255,10 @@ var apple = (options) => {
|
|
|
244
255
|
});
|
|
245
256
|
},
|
|
246
257
|
async getUserInfo(token) {
|
|
247
|
-
|
|
258
|
+
if (!token.idToken) {
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
261
|
+
const data = parseJWT(token.idToken)?.payload;
|
|
248
262
|
if (!data) {
|
|
249
263
|
return null;
|
|
250
264
|
}
|
|
@@ -290,7 +304,7 @@ var discord = (options) => {
|
|
|
290
304
|
"https://discord.com/api/users/@me",
|
|
291
305
|
{
|
|
292
306
|
headers: {
|
|
293
|
-
authorization: `Bearer ${token.accessToken
|
|
307
|
+
authorization: `Bearer ${token.accessToken}`
|
|
294
308
|
}
|
|
295
309
|
}
|
|
296
310
|
);
|
|
@@ -324,9 +338,9 @@ var facebook = (options) => {
|
|
|
324
338
|
return {
|
|
325
339
|
id: "facebook",
|
|
326
340
|
name: "Facebook",
|
|
327
|
-
createAuthorizationURL({ state, scopes, codeVerifier }) {
|
|
341
|
+
async createAuthorizationURL({ state, scopes, codeVerifier }) {
|
|
328
342
|
const _scopes = options.scope || scopes || ["email", "public_profile"];
|
|
329
|
-
return createAuthorizationURL({
|
|
343
|
+
return await createAuthorizationURL({
|
|
330
344
|
id: "facebook",
|
|
331
345
|
options,
|
|
332
346
|
authorizationEndpoint: "https://www.facebook.com/v16.0/dialog/oauth",
|
|
@@ -350,7 +364,7 @@ var facebook = (options) => {
|
|
|
350
364
|
{
|
|
351
365
|
auth: {
|
|
352
366
|
type: "Bearer",
|
|
353
|
-
token: token.accessToken
|
|
367
|
+
token: token.accessToken
|
|
354
368
|
}
|
|
355
369
|
}
|
|
356
370
|
);
|
|
@@ -402,7 +416,7 @@ var github = (options) => {
|
|
|
402
416
|
{
|
|
403
417
|
auth: {
|
|
404
418
|
type: "Bearer",
|
|
405
|
-
token: token.accessToken
|
|
419
|
+
token: token.accessToken
|
|
406
420
|
}
|
|
407
421
|
}
|
|
408
422
|
);
|
|
@@ -414,7 +428,7 @@ var github = (options) => {
|
|
|
414
428
|
const { data, error: error3 } = await betterFetch4("https://api.github.com/user/emails", {
|
|
415
429
|
auth: {
|
|
416
430
|
type: "Bearer",
|
|
417
|
-
token: token.accessToken
|
|
431
|
+
token: token.accessToken
|
|
418
432
|
}
|
|
419
433
|
});
|
|
420
434
|
if (!error3) {
|
|
@@ -520,7 +534,7 @@ var google = (options) => {
|
|
|
520
534
|
if (!token.idToken) {
|
|
521
535
|
return null;
|
|
522
536
|
}
|
|
523
|
-
const user = parseJWT2(token.idToken
|
|
537
|
+
const user = parseJWT2(token.idToken)?.payload;
|
|
524
538
|
return {
|
|
525
539
|
user: {
|
|
526
540
|
id: user.sub,
|
|
@@ -566,13 +580,16 @@ var microsoft = (options) => {
|
|
|
566
580
|
});
|
|
567
581
|
},
|
|
568
582
|
async getUserInfo(token) {
|
|
569
|
-
|
|
583
|
+
if (!token.idToken) {
|
|
584
|
+
return null;
|
|
585
|
+
}
|
|
586
|
+
const user = parseJWT3(token.idToken)?.payload;
|
|
570
587
|
const profilePhotoSize = options.profilePhotoSize || 48;
|
|
571
588
|
await betterFetch5(
|
|
572
589
|
`https://graph.microsoft.com/v1.0/me/photos/${profilePhotoSize}x${profilePhotoSize}/$value`,
|
|
573
590
|
{
|
|
574
591
|
headers: {
|
|
575
|
-
Authorization: `Bearer ${token.accessToken
|
|
592
|
+
Authorization: `Bearer ${token.accessToken}`
|
|
576
593
|
},
|
|
577
594
|
async onResponse(context) {
|
|
578
595
|
if (options.disableProfilePhoto || !context.response.ok) {
|
|
@@ -635,7 +652,7 @@ var spotify = (options) => {
|
|
|
635
652
|
{
|
|
636
653
|
method: "GET",
|
|
637
654
|
headers: {
|
|
638
|
-
Authorization: `Bearer ${token.accessToken
|
|
655
|
+
Authorization: `Bearer ${token.accessToken}`
|
|
639
656
|
}
|
|
640
657
|
}
|
|
641
658
|
);
|
|
@@ -686,7 +703,7 @@ var twitch = (options) => {
|
|
|
686
703
|
{
|
|
687
704
|
method: "GET",
|
|
688
705
|
headers: {
|
|
689
|
-
Authorization: `Bearer ${token.accessToken
|
|
706
|
+
Authorization: `Bearer ${token.accessToken}`
|
|
690
707
|
}
|
|
691
708
|
}
|
|
692
709
|
);
|
|
@@ -739,7 +756,7 @@ var twitter = (options) => {
|
|
|
739
756
|
{
|
|
740
757
|
method: "GET",
|
|
741
758
|
headers: {
|
|
742
|
-
Authorization: `Bearer ${token.accessToken
|
|
759
|
+
Authorization: `Bearer ${token.accessToken}`
|
|
743
760
|
}
|
|
744
761
|
}
|
|
745
762
|
);
|
|
@@ -763,9 +780,6 @@ var twitter = (options) => {
|
|
|
763
780
|
};
|
|
764
781
|
};
|
|
765
782
|
|
|
766
|
-
// src/social-providers/types.ts
|
|
767
|
-
import "arctic";
|
|
768
|
-
|
|
769
783
|
// src/social-providers/index.ts
|
|
770
784
|
var oAuthProviders = {
|
|
771
785
|
apple,
|
|
@@ -1059,7 +1073,7 @@ var signInOAuth = createAuthEndpoint(
|
|
|
1059
1073
|
c.context.secret,
|
|
1060
1074
|
cookie.pkCodeVerifier.options
|
|
1061
1075
|
);
|
|
1062
|
-
const url = provider.createAuthorizationURL({
|
|
1076
|
+
const url = await provider.createAuthorizationURL({
|
|
1063
1077
|
state: state.state,
|
|
1064
1078
|
codeVerifier
|
|
1065
1079
|
});
|
|
@@ -1310,11 +1324,11 @@ var HIDE_METADATA = {
|
|
|
1310
1324
|
|
|
1311
1325
|
// src/utils/getAccount.ts
|
|
1312
1326
|
function getAccountTokens(tokens) {
|
|
1313
|
-
const accessToken = tokens.accessToken
|
|
1314
|
-
let refreshToken = tokens.
|
|
1327
|
+
const accessToken = tokens.accessToken;
|
|
1328
|
+
let refreshToken = tokens.refreshToken;
|
|
1315
1329
|
let accessTokenExpiresAt = void 0;
|
|
1316
1330
|
try {
|
|
1317
|
-
accessTokenExpiresAt = tokens.accessTokenExpiresAt
|
|
1331
|
+
accessTokenExpiresAt = tokens.accessTokenExpiresAt;
|
|
1318
1332
|
} catch {
|
|
1319
1333
|
}
|
|
1320
1334
|
return {
|
package/dist/cli.js
CHANGED
|
@@ -137,7 +137,6 @@ async function getConfig({
|
|
|
137
137
|
try {
|
|
138
138
|
let configFile = null;
|
|
139
139
|
if (configPath) {
|
|
140
|
-
const alias = getPathAliases(cwd);
|
|
141
140
|
const { config } = await loadConfig({
|
|
142
141
|
configFile: path.join(cwd, configPath),
|
|
143
142
|
dotenv: true,
|
|
@@ -735,7 +734,7 @@ var migrate = new Command("migrate").option(
|
|
|
735
734
|
spinner.stop();
|
|
736
735
|
logger.info(`\u{1F511} The migration will affect the following:`);
|
|
737
736
|
for (const table of [...toBeCreated, ...toBeAdded]) {
|
|
738
|
-
|
|
737
|
+
console.log(
|
|
739
738
|
"->",
|
|
740
739
|
chalk.magenta(Object.keys(table.fields).join(", ")),
|
|
741
740
|
chalk.white("fields on"),
|
package/dist/client/plugins.d.ts
CHANGED
|
@@ -2,14 +2,13 @@ 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, j as Organization, M as Member, I as Invitation, u as username, m as magicLink, d as phoneNumber, e as anonymous, i as admin } from '../index-
|
|
6
|
-
export { g as getPasskeyActions, c as passkeyClient, a as twoFactorClient } from '../index-
|
|
5
|
+
import { o as organization, j as Organization, M as Member, I as Invitation, u as username, m as magicLink, d as phoneNumber, e as anonymous, i as admin } from '../index-BJjwxSm5.js';
|
|
6
|
+
export { g as getPasskeyActions, c as passkeyClient, a as twoFactorClient } from '../index-BJjwxSm5.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-DTlKO6LZ.js';
|
|
9
9
|
import * as better_call from 'better-call';
|
|
10
10
|
import { z } from 'zod';
|
|
11
|
-
import { U as User } from '../types-
|
|
12
|
-
import { OAuth2Tokens } from 'arctic';
|
|
11
|
+
import { O as OAuth2Tokens, U as User } from '../types-IzAbV4nB.js';
|
|
13
12
|
import '@simplewebauthn/types';
|
|
14
13
|
import 'kysely';
|
|
15
14
|
import 'better-sqlite3';
|
package/dist/client.d.ts
CHANGED
|
@@ -6,10 +6,9 @@ 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-DTlKO6LZ.js';
|
|
10
10
|
import 'kysely';
|
|
11
|
-
import './types-
|
|
12
|
-
import 'arctic';
|
|
11
|
+
import './types-IzAbV4nB.js';
|
|
13
12
|
import 'better-call';
|
|
14
13
|
import 'better-sqlite3';
|
|
15
14
|
import 'mysql2';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { U as User, S as Session } from './types-
|
|
1
|
+
import { U as User, S as Session } from './types-IzAbV4nB.js';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import { z, ZodObject, ZodOptional, ZodArray, ZodLiteral } from 'zod';
|
|
4
4
|
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-DTlKO6LZ.js';
|
|
9
9
|
import * as nanostores from 'nanostores';
|
|
10
10
|
import { atom } from 'nanostores';
|
|
11
11
|
import * as _simplewebauthn_types from '@simplewebauthn/types';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as zod from 'zod';
|
|
2
2
|
import { ZodSchema, z, ZodString, ZodOptional, ZodObject } from 'zod';
|
|
3
3
|
import { Kysely, Migration, PostgresPool, Dialect } from 'kysely';
|
|
4
|
-
import {
|
|
4
|
+
import { a as OAuthProvider, U as User, S as Session, b as SocialProviders, A as Account, c as OAuthProviderList, V as Verification } from './types-IzAbV4nB.js';
|
|
5
5
|
import * as better_call from 'better-call';
|
|
6
6
|
import { ContextTools, CookieOptions, Endpoint, EndpointResponse, Context, Prettify as Prettify$1 } from 'better-call';
|
|
7
7
|
import { L as LiteralString, D as DeepPartial, U as UnionToIntersection, S as StripEmptyObjects, P as Prettify } from './helper-DPDj8Nix.js';
|
|
@@ -1175,12 +1175,12 @@ declare const signInOAuth: {
|
|
|
1175
1175
|
/**
|
|
1176
1176
|
* OAuth2 provider to use`
|
|
1177
1177
|
*/
|
|
1178
|
-
provider: z.ZodEnum<["github", ...("
|
|
1178
|
+
provider: z.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
1179
1179
|
}, "strip", z.ZodTypeAny, {
|
|
1180
|
-
provider: "
|
|
1180
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
1181
1181
|
callbackURL?: string | undefined;
|
|
1182
1182
|
}, {
|
|
1183
|
-
provider: "
|
|
1183
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
1184
1184
|
callbackURL?: string | undefined;
|
|
1185
1185
|
}>;
|
|
1186
1186
|
}>]>(...ctx: C): Promise<C extends [{
|
|
@@ -1214,12 +1214,12 @@ declare const signInOAuth: {
|
|
|
1214
1214
|
/**
|
|
1215
1215
|
* OAuth2 provider to use`
|
|
1216
1216
|
*/
|
|
1217
|
-
provider: z.ZodEnum<["github", ...("
|
|
1217
|
+
provider: z.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
1218
1218
|
}, "strip", z.ZodTypeAny, {
|
|
1219
|
-
provider: "
|
|
1219
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
1220
1220
|
callbackURL?: string | undefined;
|
|
1221
1221
|
}, {
|
|
1222
|
-
provider: "
|
|
1222
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
1223
1223
|
callbackURL?: string | undefined;
|
|
1224
1224
|
}>;
|
|
1225
1225
|
};
|
|
@@ -2436,12 +2436,12 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
|
|
|
2436
2436
|
}>>;
|
|
2437
2437
|
body: zod.ZodObject<{
|
|
2438
2438
|
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
2439
|
-
provider: zod.ZodEnum<["github", ...("
|
|
2439
|
+
provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
2440
2440
|
}, "strip", zod.ZodTypeAny, {
|
|
2441
|
-
provider: "
|
|
2441
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
2442
2442
|
callbackURL?: string | undefined;
|
|
2443
2443
|
}, {
|
|
2444
|
-
provider: "
|
|
2444
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
2445
2445
|
callbackURL?: string | undefined;
|
|
2446
2446
|
}>;
|
|
2447
2447
|
}>]>(...ctx: C_1): Promise<C_1 extends [{
|
|
@@ -2465,12 +2465,12 @@ declare function getEndpoints<C extends AuthContext, Option extends BetterAuthOp
|
|
|
2465
2465
|
}>>;
|
|
2466
2466
|
body: zod.ZodObject<{
|
|
2467
2467
|
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
2468
|
-
provider: zod.ZodEnum<["github", ...("
|
|
2468
|
+
provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
2469
2469
|
}, "strip", zod.ZodTypeAny, {
|
|
2470
|
-
provider: "
|
|
2470
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
2471
2471
|
callbackURL?: string | undefined;
|
|
2472
2472
|
}, {
|
|
2473
|
-
provider: "
|
|
2473
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
2474
2474
|
callbackURL?: string | undefined;
|
|
2475
2475
|
}>;
|
|
2476
2476
|
};
|
|
@@ -3545,12 +3545,12 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
|
|
|
3545
3545
|
}>>;
|
|
3546
3546
|
body: zod.ZodObject<{
|
|
3547
3547
|
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
3548
|
-
provider: zod.ZodEnum<["github", ...("
|
|
3548
|
+
provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
3549
3549
|
}, "strip", zod.ZodTypeAny, {
|
|
3550
|
-
provider: "
|
|
3550
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
3551
3551
|
callbackURL?: string | undefined;
|
|
3552
3552
|
}, {
|
|
3553
|
-
provider: "
|
|
3553
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
3554
3554
|
callbackURL?: string | undefined;
|
|
3555
3555
|
}>;
|
|
3556
3556
|
}>]>(...ctx: C_1): Promise<C_1 extends [{
|
|
@@ -3574,12 +3574,12 @@ declare const router: <C extends AuthContext, Option extends BetterAuthOptions>(
|
|
|
3574
3574
|
}>>;
|
|
3575
3575
|
body: zod.ZodObject<{
|
|
3576
3576
|
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
3577
|
-
provider: zod.ZodEnum<["github", ...("
|
|
3577
|
+
provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
3578
3578
|
}, "strip", zod.ZodTypeAny, {
|
|
3579
|
-
provider: "
|
|
3579
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
3580
3580
|
callbackURL?: string | undefined;
|
|
3581
3581
|
}, {
|
|
3582
|
-
provider: "
|
|
3582
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
3583
3583
|
callbackURL?: string | undefined;
|
|
3584
3584
|
}>;
|
|
3585
3585
|
};
|
|
@@ -4656,12 +4656,12 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
|
|
|
4656
4656
|
}>>;
|
|
4657
4657
|
body: zod.ZodObject<{
|
|
4658
4658
|
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
4659
|
-
provider: zod.ZodEnum<["github", ...("
|
|
4659
|
+
provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
4660
4660
|
}, "strip", zod.ZodTypeAny, {
|
|
4661
|
-
provider: "
|
|
4661
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
4662
4662
|
callbackURL?: string | undefined;
|
|
4663
4663
|
}, {
|
|
4664
|
-
provider: "
|
|
4664
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
4665
4665
|
callbackURL?: string | undefined;
|
|
4666
4666
|
}>;
|
|
4667
4667
|
}>]>(...ctx: C): Promise<C extends [{
|
|
@@ -4685,12 +4685,12 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O) => {
|
|
|
4685
4685
|
}>>;
|
|
4686
4686
|
body: zod.ZodObject<{
|
|
4687
4687
|
callbackURL: zod.ZodOptional<zod.ZodString>;
|
|
4688
|
-
provider: zod.ZodEnum<["github", ...("
|
|
4688
|
+
provider: zod.ZodEnum<["github", ...("github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter")[]]>;
|
|
4689
4689
|
}, "strip", zod.ZodTypeAny, {
|
|
4690
|
-
provider: "
|
|
4690
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
4691
4691
|
callbackURL?: string | undefined;
|
|
4692
4692
|
}, {
|
|
4693
|
-
provider: "
|
|
4693
|
+
provider: "github" | "apple" | "discord" | "facebook" | "microsoft" | "google" | "spotify" | "twitch" | "twitter";
|
|
4694
4694
|
callbackURL?: string | undefined;
|
|
4695
4695
|
}>;
|
|
4696
4696
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export { a as Auth, a0 as betterAuth } from './index-
|
|
1
|
+
export { a as Auth, a0 as betterAuth } from './index-DTlKO6LZ.js';
|
|
2
2
|
import 'zod';
|
|
3
3
|
import 'kysely';
|
|
4
|
-
import './types-
|
|
5
|
-
import 'arctic';
|
|
4
|
+
import './types-IzAbV4nB.js';
|
|
6
5
|
import './helper-DPDj8Nix.js';
|
|
7
6
|
import 'better-call';
|
|
8
7
|
import 'better-sqlite3';
|