better-auth 1.2.4-beta.1 → 1.2.4-beta.12
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-adapter/index.cjs +6 -0
- package/dist/adapters/drizzle-adapter/index.d.cts +1 -1
- package/dist/adapters/drizzle-adapter/index.d.mts +1 -1
- package/dist/adapters/drizzle-adapter/index.d.ts +1 -1
- package/dist/adapters/drizzle-adapter/index.mjs +7 -1
- package/dist/adapters/kysely-adapter/index.d.cts +1 -1
- package/dist/adapters/kysely-adapter/index.d.mts +1 -1
- package/dist/adapters/kysely-adapter/index.d.ts +1 -1
- package/dist/adapters/memory-adapter/index.d.cts +1 -1
- package/dist/adapters/memory-adapter/index.d.mts +1 -1
- package/dist/adapters/memory-adapter/index.d.ts +1 -1
- package/dist/adapters/mongodb-adapter/index.d.cts +1 -1
- package/dist/adapters/mongodb-adapter/index.d.mts +1 -1
- package/dist/adapters/mongodb-adapter/index.d.ts +1 -1
- package/dist/adapters/prisma-adapter/index.d.cts +1 -1
- package/dist/adapters/prisma-adapter/index.d.mts +1 -1
- package/dist/adapters/prisma-adapter/index.d.ts +1 -1
- package/dist/adapters/test.d.cts +1 -1
- package/dist/adapters/test.d.mts +1 -1
- package/dist/adapters/test.d.ts +1 -1
- package/dist/api/index.cjs +3 -3
- package/dist/api/index.d.cts +1 -1
- package/dist/api/index.d.mts +1 -1
- package/dist/api/index.d.ts +1 -1
- package/dist/api/index.mjs +4 -4
- package/dist/client/index.cjs +2 -2
- package/dist/client/index.d.cts +2 -2
- package/dist/client/index.d.mts +2 -2
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.mjs +2 -2
- package/dist/client/plugins/index.cjs +91 -101
- package/dist/client/plugins/index.d.cts +15 -236
- package/dist/client/plugins/index.d.mts +15 -236
- package/dist/client/plugins/index.d.ts +15 -236
- package/dist/client/plugins/index.mjs +92 -102
- package/dist/client/react/index.cjs +17 -13
- package/dist/client/react/index.d.cts +25 -2
- package/dist/client/react/index.d.mts +25 -2
- package/dist/client/react/index.d.ts +25 -2
- package/dist/client/react/index.mjs +17 -13
- package/dist/client/solid/index.cjs +2 -2
- package/dist/client/solid/index.d.cts +1 -1
- package/dist/client/solid/index.d.mts +1 -1
- package/dist/client/solid/index.d.ts +1 -1
- package/dist/client/solid/index.mjs +2 -2
- package/dist/client/svelte/index.cjs +2 -2
- package/dist/client/svelte/index.d.cts +1 -1
- package/dist/client/svelte/index.d.mts +1 -1
- package/dist/client/svelte/index.d.ts +1 -1
- package/dist/client/svelte/index.mjs +2 -2
- package/dist/client/vue/index.cjs +2 -2
- package/dist/client/vue/index.d.cts +1 -1
- package/dist/client/vue/index.d.mts +1 -1
- package/dist/client/vue/index.d.ts +1 -1
- package/dist/client/vue/index.mjs +2 -2
- package/dist/cookies/index.cjs +6 -2
- package/dist/cookies/index.d.cts +1 -1
- package/dist/cookies/index.d.mts +1 -1
- package/dist/cookies/index.d.ts +1 -1
- package/dist/cookies/index.mjs +6 -2
- package/dist/db/index.cjs +1 -1
- package/dist/db/index.d.cts +2 -2
- package/dist/db/index.d.mts +2 -2
- package/dist/db/index.d.ts +2 -2
- package/dist/db/index.mjs +1 -1
- package/dist/index.cjs +15 -11
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.mjs +16 -12
- package/dist/integrations/next-js.cjs +5 -5
- package/dist/integrations/next-js.d.cts +1 -1
- package/dist/integrations/next-js.d.mts +1 -1
- package/dist/integrations/next-js.d.ts +1 -1
- package/dist/integrations/next-js.mjs +5 -5
- package/dist/integrations/node.d.cts +1 -1
- package/dist/integrations/node.d.mts +1 -1
- package/dist/integrations/node.d.ts +1 -1
- package/dist/integrations/svelte-kit.d.cts +1 -1
- package/dist/integrations/svelte-kit.d.mts +1 -1
- package/dist/integrations/svelte-kit.d.ts +1 -1
- package/dist/oauth2/index.cjs +1 -1
- package/dist/oauth2/index.d.cts +2 -2
- package/dist/oauth2/index.d.mts +2 -2
- package/dist/oauth2/index.d.ts +2 -2
- package/dist/oauth2/index.mjs +1 -1
- package/dist/plugins/admin/index.cjs +4 -4
- package/dist/plugins/admin/index.d.cts +1 -1
- package/dist/plugins/admin/index.d.mts +1 -1
- package/dist/plugins/admin/index.d.ts +1 -1
- package/dist/plugins/admin/index.mjs +4 -4
- package/dist/plugins/anonymous/index.cjs +3 -3
- package/dist/plugins/anonymous/index.d.cts +1 -1
- package/dist/plugins/anonymous/index.d.mts +1 -1
- package/dist/plugins/anonymous/index.d.ts +1 -1
- package/dist/plugins/anonymous/index.mjs +3 -3
- package/dist/plugins/bearer/index.cjs +3 -3
- package/dist/plugins/bearer/index.d.cts +1 -1
- package/dist/plugins/bearer/index.d.mts +1 -1
- package/dist/plugins/bearer/index.d.ts +1 -1
- package/dist/plugins/bearer/index.mjs +3 -3
- package/dist/plugins/custom-session/index.cjs +3 -3
- package/dist/plugins/custom-session/index.d.cts +1 -1
- package/dist/plugins/custom-session/index.d.mts +1 -1
- package/dist/plugins/custom-session/index.d.ts +1 -1
- package/dist/plugins/custom-session/index.mjs +3 -3
- package/dist/plugins/email-otp/index.cjs +3 -3
- package/dist/plugins/email-otp/index.d.cts +1 -1
- package/dist/plugins/email-otp/index.d.mts +1 -1
- package/dist/plugins/email-otp/index.d.ts +1 -1
- package/dist/plugins/email-otp/index.mjs +3 -3
- package/dist/plugins/generic-oauth/index.cjs +3 -3
- package/dist/plugins/generic-oauth/index.d.cts +1 -1
- package/dist/plugins/generic-oauth/index.d.mts +1 -1
- package/dist/plugins/generic-oauth/index.d.ts +1 -1
- package/dist/plugins/generic-oauth/index.mjs +3 -3
- package/dist/plugins/index.cjs +15 -17
- package/dist/plugins/index.d.cts +3 -3
- package/dist/plugins/index.d.mts +3 -3
- package/dist/plugins/index.d.ts +3 -3
- package/dist/plugins/index.mjs +15 -17
- package/dist/plugins/jwt/index.cjs +8 -4
- package/dist/plugins/jwt/index.d.cts +1 -1
- package/dist/plugins/jwt/index.d.mts +1 -1
- package/dist/plugins/jwt/index.d.ts +1 -1
- package/dist/plugins/jwt/index.mjs +8 -4
- package/dist/plugins/magic-link/index.cjs +3 -3
- package/dist/plugins/magic-link/index.mjs +3 -3
- package/dist/plugins/multi-session/index.cjs +14 -5
- package/dist/plugins/multi-session/index.d.cts +1 -1
- package/dist/plugins/multi-session/index.d.mts +1 -1
- package/dist/plugins/multi-session/index.d.ts +1 -1
- package/dist/plugins/multi-session/index.mjs +14 -5
- package/dist/plugins/oauth-proxy/index.cjs +3 -3
- package/dist/plugins/oauth-proxy/index.d.cts +1 -1
- package/dist/plugins/oauth-proxy/index.d.mts +1 -1
- package/dist/plugins/oauth-proxy/index.d.ts +1 -1
- package/dist/plugins/oauth-proxy/index.mjs +3 -3
- package/dist/plugins/oidc-provider/index.cjs +89 -17
- package/dist/plugins/oidc-provider/index.d.cts +110 -14
- package/dist/plugins/oidc-provider/index.d.mts +110 -14
- package/dist/plugins/oidc-provider/index.d.ts +110 -14
- package/dist/plugins/oidc-provider/index.mjs +89 -17
- package/dist/plugins/one-tap/index.cjs +3 -3
- package/dist/plugins/one-tap/index.mjs +3 -3
- package/dist/plugins/open-api/index.cjs +3 -3
- package/dist/plugins/open-api/index.d.cts +1 -1
- package/dist/plugins/open-api/index.d.mts +1 -1
- package/dist/plugins/open-api/index.d.ts +1 -1
- package/dist/plugins/open-api/index.mjs +3 -3
- package/dist/plugins/organization/index.cjs +5 -5
- package/dist/plugins/organization/index.d.cts +2 -2
- package/dist/plugins/organization/index.d.mts +2 -2
- package/dist/plugins/organization/index.d.ts +2 -2
- package/dist/plugins/organization/index.mjs +5 -5
- package/dist/plugins/passkey/index.cjs +3 -3
- package/dist/plugins/passkey/index.d.cts +1 -1
- package/dist/plugins/passkey/index.d.mts +1 -1
- package/dist/plugins/passkey/index.d.ts +1 -1
- package/dist/plugins/passkey/index.mjs +3 -3
- package/dist/plugins/phone-number/index.cjs +19 -11
- package/dist/plugins/phone-number/index.d.cts +4 -3
- package/dist/plugins/phone-number/index.d.mts +4 -3
- package/dist/plugins/phone-number/index.d.ts +4 -3
- package/dist/plugins/phone-number/index.mjs +19 -11
- package/dist/plugins/sso/index.cjs +3 -3
- package/dist/plugins/sso/index.d.cts +1 -1
- package/dist/plugins/sso/index.d.mts +1 -1
- package/dist/plugins/sso/index.d.ts +1 -1
- package/dist/plugins/sso/index.mjs +3 -3
- package/dist/plugins/two-factor/index.cjs +7 -7
- package/dist/plugins/two-factor/index.d.cts +1 -1
- package/dist/plugins/two-factor/index.d.mts +1 -1
- package/dist/plugins/two-factor/index.d.ts +1 -1
- package/dist/plugins/two-factor/index.mjs +7 -7
- package/dist/plugins/username/index.cjs +3 -3
- package/dist/plugins/username/index.d.cts +1 -1
- package/dist/plugins/username/index.d.mts +1 -1
- package/dist/plugins/username/index.d.ts +1 -1
- package/dist/plugins/username/index.mjs +3 -3
- package/dist/shared/{better-auth.B5NYxGA3.mjs → better-auth.67eSHmUo.mjs} +3 -7
- package/dist/shared/{better-auth.CMz4USTt.cjs → better-auth.B6Xcg5N5.cjs} +1 -1
- package/dist/shared/{better-auth.K251u4eV.mjs → better-auth.BH6IWaNB.mjs} +3 -3
- package/dist/shared/{better-auth.DNb3Aogp.cjs → better-auth.BN2jUYPL.cjs} +1 -1
- package/dist/shared/{better-auth.F2VsZ04W.d.ts → better-auth.BVojg4kv.d.ts} +1 -1
- package/dist/shared/{better-auth.BA2kubRc.d.cts → better-auth.BdjFNTuQ.d.cts} +1 -1
- package/dist/shared/{better-auth.D4ignKqt.d.mts → better-auth.BfPbu6oh.d.mts} +1 -1
- package/dist/shared/{better-auth.DhfiEsxl.cjs → better-auth.C-R0J0n1.cjs} +15 -1
- package/dist/shared/{better-auth.Bd1H94Nk.mjs → better-auth.CABkkSP8.mjs} +1 -1
- package/dist/shared/{better-auth.npe3WWSD.mjs → better-auth.CFZLHBFT.mjs} +23 -24
- package/dist/shared/{better-auth.GgQnT00n.cjs → better-auth.CHHC_PJT.cjs} +1 -0
- package/dist/shared/{better-auth.BI_ldOv7.mjs → better-auth.CHsl8t-G.mjs} +2 -7
- package/dist/shared/{better-auth.BAR_8WbD.d.cts → better-auth.CPKTEzG-.d.cts} +3 -2
- package/dist/shared/{better-auth.DXbPkpEx.cjs → better-auth.CR_ASYNx.cjs} +3 -3
- package/dist/shared/{better-auth.YSKz0i4l.mjs → better-auth.CSVqSIae.mjs} +1 -1
- package/dist/shared/{better-auth.Cx-TsLBb.d.mts → better-auth.CVOWGLfd.d.mts} +1 -1
- package/dist/shared/{better-auth.CoMXyQ1y.mjs → better-auth.CbXAPXob.mjs} +1 -0
- package/dist/shared/{better-auth.imLEY-xr.d.mts → better-auth.Ck0xlDsK.d.mts} +3 -2
- package/dist/shared/{better-auth.BS4hQYkx.d.cts → better-auth.Ckf_tP8g.d.mts} +1 -1
- package/dist/shared/{better-auth.CqfKuHli.mjs → better-auth.CmplT_y7.mjs} +11 -18
- package/dist/shared/{better-auth.BvJDkY_b.cjs → better-auth.Cr6NZZDX.cjs} +11 -18
- package/dist/shared/{better-auth.BLtLzuLI.d.cts → better-auth.DIRcdXVm.d.cts} +1 -1
- package/dist/shared/{better-auth.DayxQ0AW.d.ts → better-auth.DaeQzncE.d.ts} +1 -1
- package/dist/shared/{better-auth.CKg1f8vU.cjs → better-auth.DcpLarbN.cjs} +3 -7
- package/dist/shared/{better-auth.purQujiV.d.ts → better-auth.DiHCWsNg.d.ts} +3 -2
- package/dist/shared/{better-auth.CwDUoRLB.cjs → better-auth.Dxrp37xO.cjs} +2 -7
- package/dist/shared/{better-auth.BzKRBwSF.cjs → better-auth.GVCiTzec.cjs} +23 -24
- package/dist/shared/{better-auth.NcLhHEks.mjs → better-auth.VTXNLFMT.mjs} +15 -1
- package/dist/shared/{better-auth.BxdddeEs.d.mts → better-auth.Vci2tT86.d.cts} +1 -1
- package/dist/shared/{better-auth.977UjO4P.d.ts → better-auth.jVBEmAqh.d.ts} +1 -1
- package/dist/social-providers/index.cjs +3 -1
- package/dist/social-providers/index.mjs +3 -1
- package/dist/types/index.d.cts +4 -3
- package/dist/types/index.d.mts +4 -3
- package/dist/types/index.d.ts +4 -3
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { betterFetch } from '@better-fetch/fetch';
|
|
2
2
|
import { APIError } from 'better-call';
|
|
3
3
|
import { z } from 'zod';
|
|
4
|
-
import { a as createAuthEndpoint, s as sessionMiddleware, B as BASE_ERROR_CODES, h as handleOAuthUserInfo } from '../../shared/better-auth.
|
|
4
|
+
import { a as createAuthEndpoint, s as sessionMiddleware, B as BASE_ERROR_CODES, h as handleOAuthUserInfo } from '../../shared/better-auth.CFZLHBFT.mjs';
|
|
5
5
|
import { setSessionCookie } from '../../cookies/index.mjs';
|
|
6
6
|
import '../../shared/better-auth.C24Bzw4w.mjs';
|
|
7
7
|
import '../../shared/better-auth.8zoxzg-F.mjs';
|
|
@@ -10,7 +10,7 @@ import 'defu';
|
|
|
10
10
|
import { c as createAuthorizationURL, v as validateAuthorizationCode } from '../../shared/better-auth.D7syfoJW.mjs';
|
|
11
11
|
import '@better-auth/utils/hash';
|
|
12
12
|
import '@better-auth/utils/base64';
|
|
13
|
-
import { g as generateState, p as parseState } from '../../shared/better-auth.
|
|
13
|
+
import { g as generateState, p as parseState } from '../../shared/better-auth.CbXAPXob.mjs';
|
|
14
14
|
import { decodeJwt } from 'jose';
|
|
15
15
|
import '../../social-providers/index.mjs';
|
|
16
16
|
import '@noble/ciphers/chacha';
|
|
@@ -27,7 +27,7 @@ import '../../shared/better-auth.CW6D9eSx.mjs';
|
|
|
27
27
|
import '../../shared/better-auth.BUPPRXfK.mjs';
|
|
28
28
|
import '@better-auth/utils/hmac';
|
|
29
29
|
import '../../shared/better-auth.DDEbWX-S.mjs';
|
|
30
|
-
import '../../shared/better-auth.
|
|
30
|
+
import '../../shared/better-auth.VTXNLFMT.mjs';
|
|
31
31
|
import 'jose/errors';
|
|
32
32
|
import '../../shared/better-auth.tB5eU6EY.mjs';
|
|
33
33
|
import '@better-auth/utils/binary';
|
package/dist/plugins/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const organization = require('../shared/better-auth.
|
|
3
|
+
const organization = require('../shared/better-auth.Dxrp37xO.cjs');
|
|
4
4
|
const plugins_twoFactor_index = require('./two-factor/index.cjs');
|
|
5
5
|
const plugins_username_index = require('./username/index.cjs');
|
|
6
6
|
const plugins_bearer_index = require('./bearer/index.cjs');
|
|
7
|
-
const account = require('../shared/better-auth.
|
|
7
|
+
const account = require('../shared/better-auth.GVCiTzec.cjs');
|
|
8
8
|
const plugins_magicLink_index = require('./magic-link/index.cjs');
|
|
9
9
|
const plugins_phoneNumber_index = require('./phone-number/index.cjs');
|
|
10
10
|
const plugins_anonymous_index = require('./anonymous/index.cjs');
|
|
11
|
-
const admin = require('../shared/better-auth.
|
|
11
|
+
const admin = require('../shared/better-auth.CR_ASYNx.cjs');
|
|
12
12
|
const plugins_genericOauth_index = require('./generic-oauth/index.cjs');
|
|
13
13
|
const plugins_jwt_index = require('./jwt/index.cjs');
|
|
14
14
|
const plugins_multiSession_index = require('./multi-session/index.cjs');
|
|
@@ -46,22 +46,22 @@ const json = require('../shared/better-auth.D3mtHEZg.cjs');
|
|
|
46
46
|
const id = require('../shared/better-auth.Bg6iw3ig.cjs');
|
|
47
47
|
const plugins_access_index = require('./access/index.cjs');
|
|
48
48
|
const client = require('../shared/better-auth.DnER2-iT.cjs');
|
|
49
|
-
require('../shared/better-auth.
|
|
49
|
+
require('../shared/better-auth.Cr6NZZDX.cjs');
|
|
50
50
|
require('../cookies/index.cjs');
|
|
51
51
|
require('../shared/better-auth.ANpbi45u.cjs');
|
|
52
52
|
require('./organization/access/index.cjs');
|
|
53
53
|
require('../crypto/index.cjs');
|
|
54
54
|
require('../shared/better-auth.YUF6P-PB.cjs');
|
|
55
55
|
require('../shared/better-auth.BMYo0QR-.cjs');
|
|
56
|
-
require('../shared/better-auth.
|
|
56
|
+
require('../shared/better-auth.B6Xcg5N5.cjs');
|
|
57
57
|
require('../shared/better-auth.C1-vpKly.cjs');
|
|
58
58
|
require('@better-auth/utils/otp');
|
|
59
59
|
require('../shared/better-auth.CDXNofOe.cjs');
|
|
60
60
|
require('../social-providers/index.cjs');
|
|
61
61
|
require('@better-fetch/fetch');
|
|
62
62
|
require('../shared/better-auth.DdjqxOIu.cjs');
|
|
63
|
-
require('../shared/better-auth.
|
|
64
|
-
require('../shared/better-auth.
|
|
63
|
+
require('../shared/better-auth.CHHC_PJT.cjs');
|
|
64
|
+
require('../shared/better-auth.C-R0J0n1.cjs');
|
|
65
65
|
require('jose/errors');
|
|
66
66
|
require('@better-auth/utils/binary');
|
|
67
67
|
require('../shared/better-auth.DNqtHmvg.cjs');
|
|
@@ -264,7 +264,7 @@ const apiKeySchema = ({
|
|
|
264
264
|
function createApiKey({
|
|
265
265
|
keyGenerator,
|
|
266
266
|
opts,
|
|
267
|
-
schema
|
|
267
|
+
schema,
|
|
268
268
|
deleteAllExpiredApiKeys
|
|
269
269
|
}) {
|
|
270
270
|
return account.createAuthEndpoint(
|
|
@@ -438,17 +438,10 @@ function createApiKey({
|
|
|
438
438
|
permissions: permissionsToApply
|
|
439
439
|
};
|
|
440
440
|
if (metadata) {
|
|
441
|
-
|
|
442
|
-
data,
|
|
443
|
-
apiKeySchema({
|
|
444
|
-
rateLimitMax: opts.rateLimit.maxRequests,
|
|
445
|
-
timeWindow: opts.rateLimit.timeWindow
|
|
446
|
-
}).apikey
|
|
447
|
-
);
|
|
448
|
-
data.metadata = parseMetadata.metadata ?? null;
|
|
441
|
+
data.metadata = schema.apikey.fields.metadata.transform.input(metadata);
|
|
449
442
|
}
|
|
450
443
|
const apiKey = await ctx.context.adapter.create({
|
|
451
|
-
model: schema
|
|
444
|
+
model: schema.apikey.modelName,
|
|
452
445
|
data
|
|
453
446
|
});
|
|
454
447
|
return ctx.json({
|
|
@@ -1054,6 +1047,11 @@ function verifyApiKey({
|
|
|
1054
1047
|
}
|
|
1055
1048
|
deleteAllExpiredApiKeys(ctx.context);
|
|
1056
1049
|
const { key: _, ...returningApiKey } = newApiKey ?? { key: 1 };
|
|
1050
|
+
if ("metadata" in returningApiKey) {
|
|
1051
|
+
returningApiKey.metadata = schema.apikey.fields.metadata.transform.output(
|
|
1052
|
+
returningApiKey.metadata
|
|
1053
|
+
);
|
|
1054
|
+
}
|
|
1057
1055
|
return ctx.json({
|
|
1058
1056
|
valid: true,
|
|
1059
1057
|
error: null,
|
package/dist/plugins/index.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { O as OrganizationOptions, o as organization } from '../shared/better-auth.
|
|
1
|
+
export { O as OrganizationOptions, o as organization } from '../shared/better-auth.DIRcdXVm.cjs';
|
|
2
2
|
export { TwoFactorOptions, TwoFactorProvider, TwoFactorTable, UserWithTwoFactor, twoFactor, twoFactorClient } from './two-factor/index.cjs';
|
|
3
3
|
export { UsernameOptions, username } from './username/index.cjs';
|
|
4
4
|
export { bearer } from './bearer/index.cjs';
|
|
5
|
-
export { d as AuthEndpoint, e as AuthMiddleware, A as AuthPluginSchema, B as BetterAuthPlugin, I as InferOptionSchema, a as InferPluginErrorCodes, b as createAuthEndpoint, c as createAuthMiddleware, o as optionsMiddleware } from '../shared/better-auth.
|
|
5
|
+
export { d as AuthEndpoint, e as AuthMiddleware, A as AuthPluginSchema, B as BetterAuthPlugin, I as InferOptionSchema, a as InferPluginErrorCodes, b as createAuthEndpoint, c as createAuthMiddleware, o as optionsMiddleware } from '../shared/better-auth.CPKTEzG-.cjs';
|
|
6
6
|
export { H as HIDE_METADATA } from '../shared/better-auth.DEHJp1rk.cjs';
|
|
7
7
|
export { magicLink } from './magic-link/index.cjs';
|
|
8
8
|
export { PhoneNumberOptions, UserWithPhoneNumber, phoneNumber } from './phone-number/index.cjs';
|
|
@@ -18,7 +18,7 @@ export { customSession } from './custom-session/index.cjs';
|
|
|
18
18
|
export { OpenAPIOptions, Path, generator, openAPI } from './open-api/index.cjs';
|
|
19
19
|
export { AuthorizationQuery, Client, CodeVerificationValue, OAuthAccessToken, OIDCMetadata, OIDCOptions, TokenBody, oidcProvider } from './oidc-provider/index.cjs';
|
|
20
20
|
export { CaptchaOptions, captcha } from './captcha/index.cjs';
|
|
21
|
-
export { E as ERROR_CODES, a as apiKey } from '../shared/better-auth.
|
|
21
|
+
export { E as ERROR_CODES, a as apiKey } from '../shared/better-auth.BdjFNTuQ.cjs';
|
|
22
22
|
import './access/index.cjs';
|
|
23
23
|
import '../shared/better-auth.Bi8FQwDD.cjs';
|
|
24
24
|
import 'zod';
|
package/dist/plugins/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { O as OrganizationOptions, o as organization } from '../shared/better-auth.
|
|
1
|
+
export { O as OrganizationOptions, o as organization } from '../shared/better-auth.BfPbu6oh.mjs';
|
|
2
2
|
export { TwoFactorOptions, TwoFactorProvider, TwoFactorTable, UserWithTwoFactor, twoFactor, twoFactorClient } from './two-factor/index.mjs';
|
|
3
3
|
export { UsernameOptions, username } from './username/index.mjs';
|
|
4
4
|
export { bearer } from './bearer/index.mjs';
|
|
5
|
-
export { d as AuthEndpoint, e as AuthMiddleware, A as AuthPluginSchema, B as BetterAuthPlugin, I as InferOptionSchema, a as InferPluginErrorCodes, b as createAuthEndpoint, c as createAuthMiddleware, o as optionsMiddleware } from '../shared/better-auth.
|
|
5
|
+
export { d as AuthEndpoint, e as AuthMiddleware, A as AuthPluginSchema, B as BetterAuthPlugin, I as InferOptionSchema, a as InferPluginErrorCodes, b as createAuthEndpoint, c as createAuthMiddleware, o as optionsMiddleware } from '../shared/better-auth.Ck0xlDsK.mjs';
|
|
6
6
|
export { H as HIDE_METADATA } from '../shared/better-auth.DEHJp1rk.mjs';
|
|
7
7
|
export { magicLink } from './magic-link/index.mjs';
|
|
8
8
|
export { PhoneNumberOptions, UserWithPhoneNumber, phoneNumber } from './phone-number/index.mjs';
|
|
@@ -18,7 +18,7 @@ export { customSession } from './custom-session/index.mjs';
|
|
|
18
18
|
export { OpenAPIOptions, Path, generator, openAPI } from './open-api/index.mjs';
|
|
19
19
|
export { AuthorizationQuery, Client, CodeVerificationValue, OAuthAccessToken, OIDCMetadata, OIDCOptions, TokenBody, oidcProvider } from './oidc-provider/index.mjs';
|
|
20
20
|
export { CaptchaOptions, captcha } from './captcha/index.mjs';
|
|
21
|
-
export { E as ERROR_CODES, a as apiKey } from '../shared/better-auth.
|
|
21
|
+
export { E as ERROR_CODES, a as apiKey } from '../shared/better-auth.CVOWGLfd.mjs';
|
|
22
22
|
import './access/index.mjs';
|
|
23
23
|
import '../shared/better-auth.Bi8FQwDD.mjs';
|
|
24
24
|
import 'zod';
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { O as OrganizationOptions, o as organization } from '../shared/better-auth.
|
|
1
|
+
export { O as OrganizationOptions, o as organization } from '../shared/better-auth.jVBEmAqh.js';
|
|
2
2
|
export { TwoFactorOptions, TwoFactorProvider, TwoFactorTable, UserWithTwoFactor, twoFactor, twoFactorClient } from './two-factor/index.js';
|
|
3
3
|
export { UsernameOptions, username } from './username/index.js';
|
|
4
4
|
export { bearer } from './bearer/index.js';
|
|
5
|
-
export { d as AuthEndpoint, e as AuthMiddleware, A as AuthPluginSchema, B as BetterAuthPlugin, I as InferOptionSchema, a as InferPluginErrorCodes, b as createAuthEndpoint, c as createAuthMiddleware, o as optionsMiddleware } from '../shared/better-auth.
|
|
5
|
+
export { d as AuthEndpoint, e as AuthMiddleware, A as AuthPluginSchema, B as BetterAuthPlugin, I as InferOptionSchema, a as InferPluginErrorCodes, b as createAuthEndpoint, c as createAuthMiddleware, o as optionsMiddleware } from '../shared/better-auth.DiHCWsNg.js';
|
|
6
6
|
export { H as HIDE_METADATA } from '../shared/better-auth.DEHJp1rk.js';
|
|
7
7
|
export { magicLink } from './magic-link/index.js';
|
|
8
8
|
export { PhoneNumberOptions, UserWithPhoneNumber, phoneNumber } from './phone-number/index.js';
|
|
@@ -18,7 +18,7 @@ export { customSession } from './custom-session/index.js';
|
|
|
18
18
|
export { OpenAPIOptions, Path, generator, openAPI } from './open-api/index.js';
|
|
19
19
|
export { AuthorizationQuery, Client, CodeVerificationValue, OAuthAccessToken, OIDCMetadata, OIDCOptions, TokenBody, oidcProvider } from './oidc-provider/index.js';
|
|
20
20
|
export { CaptchaOptions, captcha } from './captcha/index.js';
|
|
21
|
-
export { E as ERROR_CODES, a as apiKey } from '../shared/better-auth.
|
|
21
|
+
export { E as ERROR_CODES, a as apiKey } from '../shared/better-auth.DaeQzncE.js';
|
|
22
22
|
import './access/index.js';
|
|
23
23
|
import '../shared/better-auth.Bi8FQwDD.js';
|
|
24
24
|
import 'zod';
|
package/dist/plugins/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
export { o as organization } from '../shared/better-auth.
|
|
1
|
+
export { o as organization } from '../shared/better-auth.CHsl8t-G.mjs';
|
|
2
2
|
export { twoFactor } from './two-factor/index.mjs';
|
|
3
3
|
export { username } from './username/index.mjs';
|
|
4
4
|
export { bearer } from './bearer/index.mjs';
|
|
5
|
-
import { a as createAuthEndpoint, g as getSessionFromCtx, s as sessionMiddleware, c as createAuthMiddleware } from '../shared/better-auth.
|
|
6
|
-
export { H as HIDE_METADATA, N as optionsMiddleware } from '../shared/better-auth.
|
|
5
|
+
import { a as createAuthEndpoint, g as getSessionFromCtx, s as sessionMiddleware, c as createAuthMiddleware } from '../shared/better-auth.CFZLHBFT.mjs';
|
|
6
|
+
export { H as HIDE_METADATA, N as optionsMiddleware } from '../shared/better-auth.CFZLHBFT.mjs';
|
|
7
7
|
export { magicLink } from './magic-link/index.mjs';
|
|
8
8
|
export { phoneNumber } from './phone-number/index.mjs';
|
|
9
9
|
export { anonymous } from './anonymous/index.mjs';
|
|
10
|
-
export { a as admin } from '../shared/better-auth.
|
|
10
|
+
export { a as admin } from '../shared/better-auth.BH6IWaNB.mjs';
|
|
11
11
|
export { genericOAuth } from './generic-oauth/index.mjs';
|
|
12
12
|
export { getJwtToken, jwt } from './jwt/index.mjs';
|
|
13
13
|
export { multiSession } from './multi-session/index.mjs';
|
|
@@ -25,7 +25,7 @@ import { z } from 'zod';
|
|
|
25
25
|
import { g as getDate } from '../shared/better-auth.CW6D9eSx.mjs';
|
|
26
26
|
import '../shared/better-auth.8zoxzg-F.mjs';
|
|
27
27
|
import '@better-auth/utils/hmac';
|
|
28
|
-
import {
|
|
28
|
+
import { m as mergeSchema } from '../shared/better-auth.C24Bzw4w.mjs';
|
|
29
29
|
import '../shared/better-auth.DH3YjMQH.mjs';
|
|
30
30
|
import { g as getIp } from '../shared/better-auth.Duk7IG0N.mjs';
|
|
31
31
|
import 'defu';
|
|
@@ -45,22 +45,22 @@ import { s as safeJSONParse } from '../shared/better-auth.tB5eU6EY.mjs';
|
|
|
45
45
|
import { g as generateId } from '../shared/better-auth.BUPPRXfK.mjs';
|
|
46
46
|
import { role } from './access/index.mjs';
|
|
47
47
|
export { t as twoFactorClient } from '../shared/better-auth.Ddw8bVyV.mjs';
|
|
48
|
-
import '../shared/better-auth.
|
|
48
|
+
import '../shared/better-auth.CmplT_y7.mjs';
|
|
49
49
|
import '../cookies/index.mjs';
|
|
50
50
|
import '../shared/better-auth.DdzSJf-n.mjs';
|
|
51
51
|
import './organization/access/index.mjs';
|
|
52
52
|
import '../crypto/index.mjs';
|
|
53
53
|
import '../shared/better-auth.OT3XFeFk.mjs';
|
|
54
54
|
import '../shared/better-auth.DDEbWX-S.mjs';
|
|
55
|
-
import '../shared/better-auth.
|
|
55
|
+
import '../shared/better-auth.CABkkSP8.mjs';
|
|
56
56
|
import '../shared/better-auth.BcoSd9tC.mjs';
|
|
57
57
|
import '@better-auth/utils/otp';
|
|
58
58
|
import '../shared/better-auth.YwDQhoPc.mjs';
|
|
59
59
|
import '../social-providers/index.mjs';
|
|
60
60
|
import '@better-fetch/fetch';
|
|
61
61
|
import '../shared/better-auth.D7syfoJW.mjs';
|
|
62
|
-
import '../shared/better-auth.
|
|
63
|
-
import '../shared/better-auth.
|
|
62
|
+
import '../shared/better-auth.CbXAPXob.mjs';
|
|
63
|
+
import '../shared/better-auth.VTXNLFMT.mjs';
|
|
64
64
|
import 'jose/errors';
|
|
65
65
|
import '@better-auth/utils/binary';
|
|
66
66
|
import '../shared/better-auth.DQI8AD7d.mjs';
|
|
@@ -437,14 +437,7 @@ function createApiKey({
|
|
|
437
437
|
permissions: permissionsToApply
|
|
438
438
|
};
|
|
439
439
|
if (metadata) {
|
|
440
|
-
|
|
441
|
-
data,
|
|
442
|
-
apiKeySchema({
|
|
443
|
-
rateLimitMax: opts.rateLimit.maxRequests,
|
|
444
|
-
timeWindow: opts.rateLimit.timeWindow
|
|
445
|
-
}).apikey
|
|
446
|
-
);
|
|
447
|
-
data.metadata = parseMetadata.metadata ?? null;
|
|
440
|
+
data.metadata = schema.apikey.fields.metadata.transform.input(metadata);
|
|
448
441
|
}
|
|
449
442
|
const apiKey = await ctx.context.adapter.create({
|
|
450
443
|
model: schema.apikey.modelName,
|
|
@@ -1053,6 +1046,11 @@ function verifyApiKey({
|
|
|
1053
1046
|
}
|
|
1054
1047
|
deleteAllExpiredApiKeys(ctx.context);
|
|
1055
1048
|
const { key: _, ...returningApiKey } = newApiKey ?? { key: 1 };
|
|
1049
|
+
if ("metadata" in returningApiKey) {
|
|
1050
|
+
returningApiKey.metadata = schema.apikey.fields.metadata.transform.output(
|
|
1051
|
+
returningApiKey.metadata
|
|
1052
|
+
);
|
|
1053
|
+
}
|
|
1056
1054
|
return ctx.json({
|
|
1057
1055
|
valid: true,
|
|
1058
1056
|
error: null,
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
const schema$1 = require('../../shared/better-auth.BG6vHVNT.cjs');
|
|
4
4
|
const jose = require('jose');
|
|
5
5
|
require('better-call');
|
|
6
|
-
const account = require('../../shared/better-auth.
|
|
6
|
+
const account = require('../../shared/better-auth.GVCiTzec.cjs');
|
|
7
7
|
require('zod');
|
|
8
|
+
const index = require('../../shared/better-auth.ANpbi45u.cjs');
|
|
8
9
|
require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
9
10
|
require('@better-auth/utils/base64');
|
|
10
11
|
require('@better-auth/utils/hmac');
|
|
@@ -13,7 +14,6 @@ require('../../shared/better-auth.GpOOav9x.cjs');
|
|
|
13
14
|
require('defu');
|
|
14
15
|
const crypto_index = require('../../crypto/index.cjs');
|
|
15
16
|
require('../../cookies/index.cjs');
|
|
16
|
-
require('../../shared/better-auth.ANpbi45u.cjs');
|
|
17
17
|
require('../../shared/better-auth.C1hdVENX.cjs');
|
|
18
18
|
require('../../shared/better-auth.D3mtHEZg.cjs');
|
|
19
19
|
require('../../social-providers/index.cjs');
|
|
@@ -29,10 +29,10 @@ require('@better-auth/utils/hex');
|
|
|
29
29
|
require('@noble/hashes/utils');
|
|
30
30
|
require('../../shared/better-auth.CYeOI8C-.cjs');
|
|
31
31
|
require('@better-auth/utils/random');
|
|
32
|
-
require('../../shared/better-auth.
|
|
32
|
+
require('../../shared/better-auth.CHHC_PJT.cjs');
|
|
33
33
|
require('../../shared/better-auth.Bg6iw3ig.cjs');
|
|
34
34
|
require('../../shared/better-auth.BMYo0QR-.cjs');
|
|
35
|
-
require('../../shared/better-auth.
|
|
35
|
+
require('../../shared/better-auth.C-R0J0n1.cjs');
|
|
36
36
|
require('jose/errors');
|
|
37
37
|
require('@better-auth/utils/binary');
|
|
38
38
|
require('../../shared/better-auth.YUF6P-PB.cjs');
|
|
@@ -101,6 +101,10 @@ async function getJwtToken(ctx, options) {
|
|
|
101
101
|
let privateWebKey = privateKeyEncryptionEnabled ? await crypto_index.symmetricDecrypt({
|
|
102
102
|
key: ctx.context.secret,
|
|
103
103
|
data: JSON.parse(key.privateKey)
|
|
104
|
+
}).catch(() => {
|
|
105
|
+
throw new index.BetterAuthError(
|
|
106
|
+
"Failed to decrypt private private key. Make sure the secret currently in use is the same as the one used to encrypt the private key. If you are using a different secret, either cleanup your jwks or disable private key encryption."
|
|
107
|
+
);
|
|
104
108
|
}) : key.privateKey;
|
|
105
109
|
const privateKey = await jose.importJWK(
|
|
106
110
|
JSON.parse(privateWebKey),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
|
-
import { U as User, S as Session, I as InferOptionSchema, H as HookEndpointContext, G as GenericEndpointContext } from '../../shared/better-auth.
|
|
2
|
+
import { U as User, S as Session, I as InferOptionSchema, H as HookEndpointContext, G as GenericEndpointContext } from '../../shared/better-auth.CPKTEzG-.cjs';
|
|
3
3
|
import '../../shared/better-auth.Bi8FQwDD.cjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'kysely';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
|
-
import { U as User, S as Session, I as InferOptionSchema, H as HookEndpointContext, G as GenericEndpointContext } from '../../shared/better-auth.
|
|
2
|
+
import { U as User, S as Session, I as InferOptionSchema, H as HookEndpointContext, G as GenericEndpointContext } from '../../shared/better-auth.Ck0xlDsK.mjs';
|
|
3
3
|
import '../../shared/better-auth.Bi8FQwDD.mjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'kysely';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
|
-
import { U as User, S as Session, I as InferOptionSchema, H as HookEndpointContext, G as GenericEndpointContext } from '../../shared/better-auth.
|
|
2
|
+
import { U as User, S as Session, I as InferOptionSchema, H as HookEndpointContext, G as GenericEndpointContext } from '../../shared/better-auth.DiHCWsNg.js';
|
|
3
3
|
import '../../shared/better-auth.Bi8FQwDD.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import 'kysely';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { s as schema } from '../../shared/better-auth.fsvwNeUx.mjs';
|
|
2
2
|
import { generateKeyPair, exportJWK, importJWK, SignJWT } from 'jose';
|
|
3
3
|
import 'better-call';
|
|
4
|
-
import { c as createAuthMiddleware, a as createAuthEndpoint, s as sessionMiddleware } from '../../shared/better-auth.
|
|
4
|
+
import { c as createAuthMiddleware, a as createAuthEndpoint, s as sessionMiddleware } from '../../shared/better-auth.CFZLHBFT.mjs';
|
|
5
5
|
import 'zod';
|
|
6
|
+
import { B as BetterAuthError } from '../../shared/better-auth.DdzSJf-n.mjs';
|
|
6
7
|
import '../../shared/better-auth.8zoxzg-F.mjs';
|
|
7
8
|
import '@better-auth/utils/base64';
|
|
8
9
|
import '@better-auth/utils/hmac';
|
|
@@ -11,7 +12,6 @@ import '../../shared/better-auth.DH3YjMQH.mjs';
|
|
|
11
12
|
import 'defu';
|
|
12
13
|
import { symmetricEncrypt, symmetricDecrypt } from '../../crypto/index.mjs';
|
|
13
14
|
import '../../cookies/index.mjs';
|
|
14
|
-
import '../../shared/better-auth.DdzSJf-n.mjs';
|
|
15
15
|
import '../../shared/better-auth.CW6D9eSx.mjs';
|
|
16
16
|
import '../../shared/better-auth.tB5eU6EY.mjs';
|
|
17
17
|
import '../../social-providers/index.mjs';
|
|
@@ -27,10 +27,10 @@ import '@better-auth/utils/hex';
|
|
|
27
27
|
import '@noble/hashes/utils';
|
|
28
28
|
import '../../shared/better-auth.B4Qoxdgc.mjs';
|
|
29
29
|
import '@better-auth/utils/random';
|
|
30
|
-
import '../../shared/better-auth.
|
|
30
|
+
import '../../shared/better-auth.CbXAPXob.mjs';
|
|
31
31
|
import '../../shared/better-auth.BUPPRXfK.mjs';
|
|
32
32
|
import '../../shared/better-auth.DDEbWX-S.mjs';
|
|
33
|
-
import '../../shared/better-auth.
|
|
33
|
+
import '../../shared/better-auth.VTXNLFMT.mjs';
|
|
34
34
|
import 'jose/errors';
|
|
35
35
|
import '@better-auth/utils/binary';
|
|
36
36
|
import '../../shared/better-auth.OT3XFeFk.mjs';
|
|
@@ -99,6 +99,10 @@ async function getJwtToken(ctx, options) {
|
|
|
99
99
|
let privateWebKey = privateKeyEncryptionEnabled ? await symmetricDecrypt({
|
|
100
100
|
key: ctx.context.secret,
|
|
101
101
|
data: JSON.parse(key.privateKey)
|
|
102
|
+
}).catch(() => {
|
|
103
|
+
throw new BetterAuthError(
|
|
104
|
+
"Failed to decrypt private private key. Make sure the secret currently in use is the same as the one used to encrypt the private key. If you are using a different secret, either cleanup your jwks or disable private key encryption."
|
|
105
|
+
);
|
|
102
106
|
}) : key.privateKey;
|
|
103
107
|
const privateKey = await importJWK(
|
|
104
108
|
JSON.parse(privateWebKey),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zod = require('zod');
|
|
4
|
-
const account = require('../../shared/better-auth.
|
|
4
|
+
const account = require('../../shared/better-auth.GVCiTzec.cjs');
|
|
5
5
|
const betterCall = require('better-call');
|
|
6
6
|
const cookies_index = require('../../cookies/index.cjs');
|
|
7
7
|
require('@better-auth/utils/hash');
|
|
@@ -25,11 +25,11 @@ require('../../shared/better-auth.DdjqxOIu.cjs');
|
|
|
25
25
|
require('../../shared/better-auth.C1hdVENX.cjs');
|
|
26
26
|
require('../../shared/better-auth.ANpbi45u.cjs');
|
|
27
27
|
require('@better-auth/utils/random');
|
|
28
|
-
require('../../shared/better-auth.
|
|
28
|
+
require('../../shared/better-auth.CHHC_PJT.cjs');
|
|
29
29
|
require('../../shared/better-auth.Bg6iw3ig.cjs');
|
|
30
30
|
require('@better-auth/utils/hmac');
|
|
31
31
|
require('../../shared/better-auth.BMYo0QR-.cjs');
|
|
32
|
-
require('../../shared/better-auth.
|
|
32
|
+
require('../../shared/better-auth.C-R0J0n1.cjs');
|
|
33
33
|
require('jose/errors');
|
|
34
34
|
require('../../shared/better-auth.D3mtHEZg.cjs');
|
|
35
35
|
require('@better-auth/utils/binary');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { a as createAuthEndpoint, o as originCheck, B as BASE_ERROR_CODES } from '../../shared/better-auth.
|
|
2
|
+
import { a as createAuthEndpoint, o as originCheck, B as BASE_ERROR_CODES } from '../../shared/better-auth.CFZLHBFT.mjs';
|
|
3
3
|
import { APIError } from 'better-call';
|
|
4
4
|
import { setSessionCookie } from '../../cookies/index.mjs';
|
|
5
5
|
import '@better-auth/utils/hash';
|
|
@@ -23,11 +23,11 @@ import '../../shared/better-auth.D7syfoJW.mjs';
|
|
|
23
23
|
import '../../shared/better-auth.CW6D9eSx.mjs';
|
|
24
24
|
import '../../shared/better-auth.DdzSJf-n.mjs';
|
|
25
25
|
import '@better-auth/utils/random';
|
|
26
|
-
import '../../shared/better-auth.
|
|
26
|
+
import '../../shared/better-auth.CbXAPXob.mjs';
|
|
27
27
|
import '../../shared/better-auth.BUPPRXfK.mjs';
|
|
28
28
|
import '@better-auth/utils/hmac';
|
|
29
29
|
import '../../shared/better-auth.DDEbWX-S.mjs';
|
|
30
|
-
import '../../shared/better-auth.
|
|
30
|
+
import '../../shared/better-auth.VTXNLFMT.mjs';
|
|
31
31
|
import 'jose/errors';
|
|
32
32
|
import '../../shared/better-auth.tB5eU6EY.mjs';
|
|
33
33
|
import '@better-auth/utils/binary';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const zod = require('zod');
|
|
4
4
|
const betterCall = require('better-call');
|
|
5
|
-
const account = require('../../shared/better-auth.
|
|
5
|
+
const account = require('../../shared/better-auth.GVCiTzec.cjs');
|
|
6
6
|
const cookies_index = require('../../cookies/index.cjs');
|
|
7
7
|
require('../../shared/better-auth.CHyZMcYK.cjs');
|
|
8
8
|
require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
@@ -25,11 +25,11 @@ require('@noble/hashes/utils');
|
|
|
25
25
|
require('../../shared/better-auth.CYeOI8C-.cjs');
|
|
26
26
|
require('@better-auth/utils/random');
|
|
27
27
|
require('../../shared/better-auth.ANpbi45u.cjs');
|
|
28
|
-
require('../../shared/better-auth.
|
|
28
|
+
require('../../shared/better-auth.CHHC_PJT.cjs');
|
|
29
29
|
require('../../shared/better-auth.Bg6iw3ig.cjs');
|
|
30
30
|
require('@better-auth/utils/hmac');
|
|
31
31
|
require('../../shared/better-auth.BMYo0QR-.cjs');
|
|
32
|
-
require('../../shared/better-auth.
|
|
32
|
+
require('../../shared/better-auth.C-R0J0n1.cjs');
|
|
33
33
|
require('jose/errors');
|
|
34
34
|
require('../../shared/better-auth.D3mtHEZg.cjs');
|
|
35
35
|
require('@better-auth/utils/binary');
|
|
@@ -66,7 +66,16 @@ const multiSession = (options) => {
|
|
|
66
66
|
const validSessions = sessions.filter(
|
|
67
67
|
(session) => session && session.session.expiresAt > /* @__PURE__ */ new Date()
|
|
68
68
|
);
|
|
69
|
-
|
|
69
|
+
const uniqueUserSessions = validSessions.reduce(
|
|
70
|
+
(acc, session) => {
|
|
71
|
+
if (!acc.find((s) => s.user.id === session.user.id)) {
|
|
72
|
+
acc.push(session);
|
|
73
|
+
}
|
|
74
|
+
return acc;
|
|
75
|
+
},
|
|
76
|
+
[]
|
|
77
|
+
);
|
|
78
|
+
return ctx.json(uniqueUserSessions);
|
|
70
79
|
}
|
|
71
80
|
),
|
|
72
81
|
setActiveSession: account.createAuthEndpoint(
|
|
@@ -165,7 +174,7 @@ const multiSession = (options) => {
|
|
|
165
174
|
},
|
|
166
175
|
async (ctx) => {
|
|
167
176
|
const sessionToken = ctx.body.sessionToken;
|
|
168
|
-
const multiSessionCookieName = `${ctx.context.authCookies.sessionToken.name}_multi-${sessionToken}`;
|
|
177
|
+
const multiSessionCookieName = `${ctx.context.authCookies.sessionToken.name}_multi-${sessionToken.toLowerCase()}`;
|
|
169
178
|
const sessionCookie = await ctx.getSignedCookie(
|
|
170
179
|
multiSessionCookieName,
|
|
171
180
|
ctx.context.secret
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
|
-
import { S as Session, U as User, H as HookEndpointContext } from '../../shared/better-auth.
|
|
3
|
+
import { S as Session, U as User, H as HookEndpointContext } from '../../shared/better-auth.CPKTEzG-.cjs';
|
|
4
4
|
import '../../shared/better-auth.Bi8FQwDD.cjs';
|
|
5
5
|
import 'kysely';
|
|
6
6
|
import '../../shared/better-auth.GFrhA2ZN.cjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
|
-
import { S as Session, U as User, H as HookEndpointContext } from '../../shared/better-auth.
|
|
3
|
+
import { S as Session, U as User, H as HookEndpointContext } from '../../shared/better-auth.Ck0xlDsK.mjs';
|
|
4
4
|
import '../../shared/better-auth.Bi8FQwDD.mjs';
|
|
5
5
|
import 'kysely';
|
|
6
6
|
import '../../shared/better-auth.Dzvtygs8.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
|
-
import { S as Session, U as User, H as HookEndpointContext } from '../../shared/better-auth.
|
|
3
|
+
import { S as Session, U as User, H as HookEndpointContext } from '../../shared/better-auth.DiHCWsNg.js';
|
|
4
4
|
import '../../shared/better-auth.Bi8FQwDD.js';
|
|
5
5
|
import 'kysely';
|
|
6
6
|
import '../../shared/better-auth.BRpbZ8Wm.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { APIError } from 'better-call';
|
|
3
|
-
import { c as createAuthMiddleware, a as createAuthEndpoint, s as sessionMiddleware } from '../../shared/better-auth.
|
|
3
|
+
import { c as createAuthMiddleware, a as createAuthEndpoint, s as sessionMiddleware } from '../../shared/better-auth.CFZLHBFT.mjs';
|
|
4
4
|
import { parseSetCookieHeader, parseCookies, setSessionCookie, deleteSessionCookie } from '../../cookies/index.mjs';
|
|
5
5
|
import '../../shared/better-auth.C24Bzw4w.mjs';
|
|
6
6
|
import '../../shared/better-auth.8zoxzg-F.mjs';
|
|
@@ -23,11 +23,11 @@ import '@noble/hashes/utils';
|
|
|
23
23
|
import '../../shared/better-auth.B4Qoxdgc.mjs';
|
|
24
24
|
import '@better-auth/utils/random';
|
|
25
25
|
import '../../shared/better-auth.DdzSJf-n.mjs';
|
|
26
|
-
import '../../shared/better-auth.
|
|
26
|
+
import '../../shared/better-auth.CbXAPXob.mjs';
|
|
27
27
|
import '../../shared/better-auth.BUPPRXfK.mjs';
|
|
28
28
|
import '@better-auth/utils/hmac';
|
|
29
29
|
import '../../shared/better-auth.DDEbWX-S.mjs';
|
|
30
|
-
import '../../shared/better-auth.
|
|
30
|
+
import '../../shared/better-auth.VTXNLFMT.mjs';
|
|
31
31
|
import 'jose/errors';
|
|
32
32
|
import '../../shared/better-auth.tB5eU6EY.mjs';
|
|
33
33
|
import '@better-auth/utils/binary';
|
|
@@ -64,7 +64,16 @@ const multiSession = (options) => {
|
|
|
64
64
|
const validSessions = sessions.filter(
|
|
65
65
|
(session) => session && session.session.expiresAt > /* @__PURE__ */ new Date()
|
|
66
66
|
);
|
|
67
|
-
|
|
67
|
+
const uniqueUserSessions = validSessions.reduce(
|
|
68
|
+
(acc, session) => {
|
|
69
|
+
if (!acc.find((s) => s.user.id === session.user.id)) {
|
|
70
|
+
acc.push(session);
|
|
71
|
+
}
|
|
72
|
+
return acc;
|
|
73
|
+
},
|
|
74
|
+
[]
|
|
75
|
+
);
|
|
76
|
+
return ctx.json(uniqueUserSessions);
|
|
68
77
|
}
|
|
69
78
|
),
|
|
70
79
|
setActiveSession: createAuthEndpoint(
|
|
@@ -163,7 +172,7 @@ const multiSession = (options) => {
|
|
|
163
172
|
},
|
|
164
173
|
async (ctx) => {
|
|
165
174
|
const sessionToken = ctx.body.sessionToken;
|
|
166
|
-
const multiSessionCookieName = `${ctx.context.authCookies.sessionToken.name}_multi-${sessionToken}`;
|
|
175
|
+
const multiSessionCookieName = `${ctx.context.authCookies.sessionToken.name}_multi-${sessionToken.toLowerCase()}`;
|
|
167
176
|
const sessionCookie = await ctx.getSignedCookie(
|
|
168
177
|
multiSessionCookieName,
|
|
169
178
|
ctx.context.secret
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const zod = require('zod');
|
|
4
4
|
require('better-call');
|
|
5
|
-
const account = require('../../shared/better-auth.
|
|
5
|
+
const account = require('../../shared/better-auth.GVCiTzec.cjs');
|
|
6
6
|
const env = require('../../shared/better-auth.DiSjtgs9.cjs');
|
|
7
7
|
require('@better-auth/utils/base64');
|
|
8
8
|
require('@better-auth/utils/hmac');
|
|
@@ -10,7 +10,7 @@ require('../../shared/better-auth.CHyZMcYK.cjs');
|
|
|
10
10
|
require('../../shared/better-auth.GpOOav9x.cjs');
|
|
11
11
|
require('defu');
|
|
12
12
|
const crypto_index = require('../../crypto/index.cjs');
|
|
13
|
-
const url = require('../../shared/better-auth.
|
|
13
|
+
const url = require('../../shared/better-auth.C-R0J0n1.cjs');
|
|
14
14
|
require('../../cookies/index.cjs');
|
|
15
15
|
require('../../shared/better-auth.ANpbi45u.cjs');
|
|
16
16
|
require('../../shared/better-auth.C1hdVENX.cjs');
|
|
@@ -29,7 +29,7 @@ require('@better-auth/utils/hex');
|
|
|
29
29
|
require('@noble/hashes/utils');
|
|
30
30
|
require('../../shared/better-auth.CYeOI8C-.cjs');
|
|
31
31
|
require('@better-auth/utils/random');
|
|
32
|
-
require('../../shared/better-auth.
|
|
32
|
+
require('../../shared/better-auth.CHHC_PJT.cjs');
|
|
33
33
|
require('../../shared/better-auth.Bg6iw3ig.cjs');
|
|
34
34
|
require('../../shared/better-auth.BMYo0QR-.cjs');
|
|
35
35
|
require('jose/errors');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
|
-
import { H as HookEndpointContext, l as AuthContext } from '../../shared/better-auth.
|
|
3
|
+
import { H as HookEndpointContext, l as AuthContext } from '../../shared/better-auth.CPKTEzG-.cjs';
|
|
4
4
|
import '../../shared/better-auth.Bi8FQwDD.cjs';
|
|
5
5
|
import 'kysely';
|
|
6
6
|
import '../../shared/better-auth.GFrhA2ZN.cjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
|
-
import { H as HookEndpointContext, l as AuthContext } from '../../shared/better-auth.
|
|
3
|
+
import { H as HookEndpointContext, l as AuthContext } from '../../shared/better-auth.Ck0xlDsK.mjs';
|
|
4
4
|
import '../../shared/better-auth.Bi8FQwDD.mjs';
|
|
5
5
|
import 'kysely';
|
|
6
6
|
import '../../shared/better-auth.Dzvtygs8.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
|
-
import { H as HookEndpointContext, l as AuthContext } from '../../shared/better-auth.
|
|
3
|
+
import { H as HookEndpointContext, l as AuthContext } from '../../shared/better-auth.DiHCWsNg.js';
|
|
4
4
|
import '../../shared/better-auth.Bi8FQwDD.js';
|
|
5
5
|
import 'kysely';
|
|
6
6
|
import '../../shared/better-auth.BRpbZ8Wm.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import 'better-call';
|
|
3
|
-
import { c as createAuthMiddleware, a as createAuthEndpoint, o as originCheck } from '../../shared/better-auth.
|
|
3
|
+
import { c as createAuthMiddleware, a as createAuthEndpoint, o as originCheck } from '../../shared/better-auth.CFZLHBFT.mjs';
|
|
4
4
|
import { e as env } from '../../shared/better-auth.8zoxzg-F.mjs';
|
|
5
5
|
import '@better-auth/utils/base64';
|
|
6
6
|
import '@better-auth/utils/hmac';
|
|
@@ -8,7 +8,7 @@ import '../../shared/better-auth.C24Bzw4w.mjs';
|
|
|
8
8
|
import '../../shared/better-auth.DH3YjMQH.mjs';
|
|
9
9
|
import 'defu';
|
|
10
10
|
import { symmetricEncrypt, symmetricDecrypt } from '../../crypto/index.mjs';
|
|
11
|
-
import { g as getOrigin } from '../../shared/better-auth.
|
|
11
|
+
import { g as getOrigin } from '../../shared/better-auth.VTXNLFMT.mjs';
|
|
12
12
|
import '../../cookies/index.mjs';
|
|
13
13
|
import '../../shared/better-auth.DdzSJf-n.mjs';
|
|
14
14
|
import '../../shared/better-auth.CW6D9eSx.mjs';
|
|
@@ -27,7 +27,7 @@ import '@better-auth/utils/hex';
|
|
|
27
27
|
import '@noble/hashes/utils';
|
|
28
28
|
import '../../shared/better-auth.B4Qoxdgc.mjs';
|
|
29
29
|
import '@better-auth/utils/random';
|
|
30
|
-
import '../../shared/better-auth.
|
|
30
|
+
import '../../shared/better-auth.CbXAPXob.mjs';
|
|
31
31
|
import '../../shared/better-auth.BUPPRXfK.mjs';
|
|
32
32
|
import '../../shared/better-auth.DDEbWX-S.mjs';
|
|
33
33
|
import 'jose/errors';
|