better-auth 1.3.8-beta.6 → 1.3.8-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-adapter/index.d.cts +2 -2
- package/dist/adapters/drizzle-adapter/index.d.mts +2 -2
- package/dist/adapters/drizzle-adapter/index.d.ts +2 -2
- package/dist/adapters/index.d.cts +3 -3
- package/dist/adapters/index.d.mts +3 -3
- package/dist/adapters/index.d.ts +3 -3
- package/dist/adapters/kysely-adapter/index.d.cts +2 -2
- package/dist/adapters/kysely-adapter/index.d.mts +2 -2
- package/dist/adapters/kysely-adapter/index.d.ts +2 -2
- package/dist/adapters/memory-adapter/index.d.cts +2 -2
- package/dist/adapters/memory-adapter/index.d.mts +2 -2
- package/dist/adapters/memory-adapter/index.d.ts +2 -2
- package/dist/adapters/mongodb-adapter/index.d.cts +2 -2
- package/dist/adapters/mongodb-adapter/index.d.mts +2 -2
- package/dist/adapters/mongodb-adapter/index.d.ts +2 -2
- package/dist/adapters/prisma-adapter/index.d.cts +2 -2
- package/dist/adapters/prisma-adapter/index.d.mts +2 -2
- package/dist/adapters/prisma-adapter/index.d.ts +2 -2
- package/dist/adapters/test.d.cts +27 -27
- package/dist/adapters/test.d.mts +27 -27
- package/dist/adapters/test.d.ts +27 -27
- package/dist/api/index.cjs +3 -3
- package/dist/api/index.d.cts +3 -3
- package/dist/api/index.d.mts +3 -3
- package/dist/api/index.d.ts +3 -3
- package/dist/api/index.mjs +5 -5
- package/dist/client/index.cjs +3 -3
- package/dist/client/index.d.cts +8 -6
- package/dist/client/index.d.mts +8 -6
- package/dist/client/index.d.ts +8 -6
- package/dist/client/index.mjs +3 -3
- package/dist/client/plugins/index.cjs +1 -1
- package/dist/client/plugins/index.d.cts +19 -11
- package/dist/client/plugins/index.d.mts +19 -11
- package/dist/client/plugins/index.d.ts +19 -11
- package/dist/client/plugins/index.mjs +1 -1
- package/dist/client/react/index.cjs +2 -2
- package/dist/client/react/index.d.cts +7 -5
- package/dist/client/react/index.d.mts +7 -5
- package/dist/client/react/index.d.ts +7 -5
- package/dist/client/react/index.mjs +2 -2
- package/dist/client/solid/index.cjs +2 -2
- package/dist/client/solid/index.d.cts +10 -10
- package/dist/client/solid/index.d.mts +10 -10
- package/dist/client/solid/index.d.ts +10 -10
- package/dist/client/solid/index.mjs +2 -2
- package/dist/client/svelte/index.cjs +2 -2
- package/dist/client/svelte/index.d.cts +4 -4
- package/dist/client/svelte/index.d.mts +4 -4
- package/dist/client/svelte/index.d.ts +4 -4
- package/dist/client/svelte/index.mjs +2 -2
- package/dist/client/vue/index.cjs +2 -2
- package/dist/client/vue/index.d.cts +13 -13
- package/dist/client/vue/index.d.mts +13 -13
- package/dist/client/vue/index.d.ts +13 -13
- package/dist/client/vue/index.mjs +2 -2
- package/dist/cookies/index.cjs +1 -1
- package/dist/cookies/index.d.cts +2 -2
- package/dist/cookies/index.d.mts +2 -2
- package/dist/cookies/index.d.ts +2 -2
- package/dist/cookies/index.mjs +1 -1
- package/dist/db/index.d.cts +3 -3
- package/dist/db/index.d.mts +3 -3
- package/dist/db/index.d.ts +3 -3
- package/dist/index.cjs +11 -10
- package/dist/index.d.cts +7 -6
- package/dist/index.d.mts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.mjs +10 -10
- package/dist/integrations/next-js.cjs +5 -4
- package/dist/integrations/next-js.d.cts +2 -2
- package/dist/integrations/next-js.d.mts +2 -2
- package/dist/integrations/next-js.d.ts +2 -2
- package/dist/integrations/next-js.mjs +5 -4
- package/dist/integrations/node.d.cts +2 -2
- package/dist/integrations/node.d.mts +2 -2
- package/dist/integrations/node.d.ts +2 -2
- package/dist/integrations/react-start.cjs +5 -4
- package/dist/integrations/react-start.d.cts +2 -2
- package/dist/integrations/react-start.d.mts +2 -2
- package/dist/integrations/react-start.d.ts +2 -2
- package/dist/integrations/react-start.mjs +5 -4
- package/dist/integrations/svelte-kit.cjs +3 -3
- package/dist/integrations/svelte-kit.d.cts +2 -2
- package/dist/integrations/svelte-kit.d.mts +2 -2
- package/dist/integrations/svelte-kit.d.ts +2 -2
- package/dist/integrations/svelte-kit.mjs +3 -3
- package/dist/oauth2/index.cjs +3 -3
- package/dist/oauth2/index.d.cts +4 -4
- package/dist/oauth2/index.d.mts +4 -4
- package/dist/oauth2/index.d.ts +4 -4
- package/dist/oauth2/index.mjs +3 -3
- package/dist/plugins/admin/index.cjs +4 -4
- package/dist/plugins/admin/index.d.cts +4 -4
- package/dist/plugins/admin/index.d.mts +4 -4
- package/dist/plugins/admin/index.d.ts +4 -4
- package/dist/plugins/admin/index.mjs +4 -4
- package/dist/plugins/anonymous/index.cjs +3 -3
- package/dist/plugins/anonymous/index.d.cts +2 -2
- package/dist/plugins/anonymous/index.d.mts +2 -2
- package/dist/plugins/anonymous/index.d.ts +2 -2
- package/dist/plugins/anonymous/index.mjs +3 -3
- package/dist/plugins/bearer/index.cjs +3 -3
- package/dist/plugins/bearer/index.d.cts +2 -2
- package/dist/plugins/bearer/index.d.mts +2 -2
- package/dist/plugins/bearer/index.d.ts +2 -2
- package/dist/plugins/bearer/index.mjs +3 -3
- package/dist/plugins/captcha/index.d.cts +2 -2
- package/dist/plugins/captcha/index.d.mts +2 -2
- package/dist/plugins/captcha/index.d.ts +2 -2
- package/dist/plugins/custom-session/index.cjs +20 -4
- package/dist/plugins/custom-session/index.d.cts +17 -3
- package/dist/plugins/custom-session/index.d.mts +17 -3
- package/dist/plugins/custom-session/index.d.ts +17 -3
- package/dist/plugins/custom-session/index.mjs +20 -4
- package/dist/plugins/device-authorization/index.cjs +9 -108
- package/dist/plugins/device-authorization/index.d.cts +5 -3
- package/dist/plugins/device-authorization/index.d.mts +5 -3
- package/dist/plugins/device-authorization/index.d.ts +5 -3
- package/dist/plugins/device-authorization/index.mjs +5 -104
- package/dist/plugins/email-otp/index.cjs +3 -3
- package/dist/plugins/email-otp/index.d.cts +2 -2
- package/dist/plugins/email-otp/index.d.mts +2 -2
- package/dist/plugins/email-otp/index.d.ts +2 -2
- 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 +3 -3
- package/dist/plugins/generic-oauth/index.d.mts +3 -3
- package/dist/plugins/generic-oauth/index.d.ts +3 -3
- package/dist/plugins/generic-oauth/index.mjs +3 -3
- package/dist/plugins/haveibeenpwned/index.cjs +3 -3
- package/dist/plugins/haveibeenpwned/index.d.cts +2 -2
- package/dist/plugins/haveibeenpwned/index.d.mts +2 -2
- package/dist/plugins/haveibeenpwned/index.d.ts +2 -2
- package/dist/plugins/haveibeenpwned/index.mjs +3 -3
- package/dist/plugins/index.cjs +9 -9
- package/dist/plugins/index.d.cts +30 -5
- package/dist/plugins/index.d.mts +30 -5
- package/dist/plugins/index.d.ts +30 -5
- package/dist/plugins/index.mjs +11 -11
- package/dist/plugins/jwt/index.cjs +6 -6
- package/dist/plugins/jwt/index.d.cts +2 -2
- package/dist/plugins/jwt/index.d.mts +2 -2
- package/dist/plugins/jwt/index.d.ts +2 -2
- package/dist/plugins/jwt/index.mjs +7 -7
- 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 +3 -3
- package/dist/plugins/multi-session/index.d.cts +2 -2
- package/dist/plugins/multi-session/index.d.mts +2 -2
- package/dist/plugins/multi-session/index.d.ts +2 -2
- package/dist/plugins/multi-session/index.mjs +3 -3
- package/dist/plugins/oauth-proxy/index.cjs +3 -3
- package/dist/plugins/oauth-proxy/index.d.cts +2 -2
- package/dist/plugins/oauth-proxy/index.d.mts +2 -2
- package/dist/plugins/oauth-proxy/index.d.ts +2 -2
- package/dist/plugins/oauth-proxy/index.mjs +3 -3
- package/dist/plugins/oidc-provider/index.cjs +5 -5
- package/dist/plugins/oidc-provider/index.d.cts +56 -6
- package/dist/plugins/oidc-provider/index.d.mts +56 -6
- package/dist/plugins/oidc-provider/index.d.ts +56 -6
- package/dist/plugins/oidc-provider/index.mjs +5 -5
- package/dist/plugins/one-tap/index.cjs +3 -3
- package/dist/plugins/one-tap/index.mjs +3 -3
- package/dist/plugins/one-time-token/index.cjs +6 -5
- package/dist/plugins/one-time-token/index.d.cts +2 -2
- package/dist/plugins/one-time-token/index.d.mts +2 -2
- package/dist/plugins/one-time-token/index.d.ts +2 -2
- package/dist/plugins/one-time-token/index.mjs +6 -5
- package/dist/plugins/open-api/index.cjs +3 -3
- package/dist/plugins/open-api/index.d.cts +2 -2
- package/dist/plugins/open-api/index.d.mts +2 -2
- package/dist/plugins/open-api/index.d.ts +2 -2
- package/dist/plugins/open-api/index.mjs +3 -3
- package/dist/plugins/organization/index.cjs +5 -5
- package/dist/plugins/organization/index.d.cts +419 -40
- package/dist/plugins/organization/index.d.mts +419 -40
- package/dist/plugins/organization/index.d.ts +419 -40
- package/dist/plugins/organization/index.mjs +5 -5
- package/dist/plugins/passkey/index.cjs +3 -3
- package/dist/plugins/passkey/index.d.cts +2 -2
- package/dist/plugins/passkey/index.d.mts +2 -2
- package/dist/plugins/passkey/index.d.ts +2 -2
- package/dist/plugins/passkey/index.mjs +3 -3
- package/dist/plugins/phone-number/index.cjs +3 -3
- package/dist/plugins/phone-number/index.d.cts +2 -2
- package/dist/plugins/phone-number/index.d.mts +2 -2
- package/dist/plugins/phone-number/index.d.ts +2 -2
- package/dist/plugins/phone-number/index.mjs +3 -3
- package/dist/plugins/siwe/index.cjs +3 -3
- package/dist/plugins/siwe/index.d.cts +2 -2
- package/dist/plugins/siwe/index.d.mts +2 -2
- package/dist/plugins/siwe/index.d.ts +2 -2
- package/dist/plugins/siwe/index.mjs +3 -3
- package/dist/plugins/sso/index.cjs +3 -3
- package/dist/plugins/sso/index.d.cts +4 -4
- package/dist/plugins/sso/index.d.mts +4 -4
- package/dist/plugins/sso/index.d.ts +4 -4
- package/dist/plugins/sso/index.mjs +3 -3
- package/dist/plugins/two-factor/index.cjs +3 -3
- package/dist/plugins/two-factor/index.d.cts +2 -2
- package/dist/plugins/two-factor/index.d.mts +2 -2
- package/dist/plugins/two-factor/index.d.ts +2 -2
- package/dist/plugins/two-factor/index.mjs +3 -3
- package/dist/plugins/username/index.cjs +3 -3
- package/dist/plugins/username/index.d.cts +2 -2
- package/dist/plugins/username/index.d.mts +2 -2
- package/dist/plugins/username/index.d.ts +2 -2
- package/dist/plugins/username/index.mjs +3 -3
- package/dist/shared/{better-auth.BVPwsVUn.d.cts → better-auth.B4AfIoAe.d.cts} +1 -1
- package/dist/shared/{better-auth.CtToz4qL.cjs → better-auth.BEsywhdZ.cjs} +2 -8
- package/dist/shared/{better-auth.BttC_x9D.mjs → better-auth.BF0OhhL0.mjs} +57 -1
- package/dist/shared/{better-auth.CGGao4aY.mjs → better-auth.BI4JniQN.mjs} +2 -8
- package/dist/shared/{better-auth.DQINKBiT.d.cts → better-auth.BVRe9oUF.d.cts} +479 -6
- package/dist/shared/{better-auth.CV-4ifSd.cjs → better-auth.BYiXvdJQ.cjs} +2 -2
- package/dist/shared/{better-auth.CbBksUvo.cjs → better-auth.BZ1rl9jb.cjs} +3 -3
- package/dist/shared/{better-auth.z3V3mA_O.cjs → better-auth.BhdSraHG.cjs} +3 -3
- package/dist/shared/{better-auth.AeIHgLBF.cjs → better-auth.BvYLXwvp.cjs} +58 -2
- package/dist/shared/{better-auth.BwsH8S4P.d.mts → better-auth.BxhI-ev4.d.mts} +6 -2
- package/dist/shared/{better-auth.DDozCDMS.mjs → better-auth.CBOi2vmh.mjs} +472 -65
- package/dist/shared/{better-auth.Ba_pqY0l.mjs → better-auth.CG9DHk60.mjs} +2 -2
- package/dist/shared/{better-auth.Bco357J8.cjs → better-auth.CLv80Pwz.cjs} +1 -1
- package/dist/shared/{better-auth.B6V3vOfp.d.cts → better-auth.COmDGkw-.d.cts} +6 -2
- package/dist/shared/{better-auth.BsHw2sS5.d.ts → better-auth.CS5xXOXV.d.ts} +6 -2
- package/dist/shared/{better-auth.C7BLzxG2.d.mts → better-auth.CYdzDlsq.d.mts} +1 -1
- package/dist/shared/{better-auth.CmdI9lHT.cjs → better-auth.CZpfmhXT.cjs} +1 -1
- package/dist/shared/{better-auth.D_zuKEZs.d.ts → better-auth.CdcdinCF.d.ts} +59 -59
- package/dist/shared/{better-auth.Ck3n8bMC.cjs → better-auth.CgIMrxKr.cjs} +7 -3
- package/dist/shared/{better-auth.BKqT_ZVS.cjs → better-auth.Cm_V_J8I.cjs} +10 -28
- package/dist/shared/{better-auth.DI5tnNZs.d.ts → better-auth.CnJoIxG_.d.ts} +479 -6
- package/dist/shared/{better-auth.Bp6xdiY8.d.ts → better-auth.CnXw9Yrh.d.mts} +2 -2
- package/dist/shared/{better-auth.DxG__zXA.d.ts → better-auth.CnsUttgT.d.ts} +1 -1
- package/dist/shared/{better-auth.yHdubbkw.cjs → better-auth.CxKBteqV.cjs} +34 -9
- package/dist/shared/{better-auth.CGejYPX3.d.mts → better-auth.CzZpBsE1.d.cts} +2 -2
- package/dist/shared/{better-auth.l2-e84v_.cjs → better-auth.D5q0JUiv.cjs} +93 -164
- package/dist/shared/{better-auth.B1puuIwv.d.mts → better-auth.D75jtXt8.d.mts} +59 -59
- package/dist/shared/{better-auth.BCc3zPBF.mjs → better-auth.DV5EHeYG.mjs} +1 -1
- package/dist/shared/{better-auth.w5Mg3-u0.mjs → better-auth.DX9TcqCt.mjs} +3 -3
- package/dist/shared/{better-auth.DGJgCfAm.mjs → better-auth.DqbGTNEt.mjs} +34 -9
- package/dist/shared/{better-auth.DgX9nQ3e.mjs → better-auth.K0z8EJFS.mjs} +3 -3
- package/dist/shared/{better-auth.CWKgK_p2.d.cts → better-auth.Otfjue7Z.d.cts} +59 -59
- package/dist/shared/{better-auth.DF-MUmVw.mjs → better-auth.UfVWArIB.mjs} +93 -164
- package/dist/shared/{better-auth.BVF2_YJN.mjs → better-auth._2xnM2S3.mjs} +351 -24
- package/dist/shared/{better-auth.L_XZAIeN.cjs → better-auth._gj_Mjo_.cjs} +472 -65
- package/dist/shared/{better-auth.QB8jx8j0.d.mts → better-auth.efEqxJ3k.d.mts} +479 -6
- package/dist/shared/{better-auth.CiuRzSQH.cjs → better-auth.g2ow3cc2.cjs} +354 -23
- package/dist/shared/{better-auth.DVsI0DHa.mjs → better-auth.ifuaFFT6.mjs} +1 -1
- package/dist/shared/{better-auth.Buni1mmI.mjs → better-auth.kTs0zHGZ.mjs} +7 -3
- package/dist/shared/{better-auth.DAX7uGE1.mjs → better-auth.vI-5STVo.mjs} +10 -28
- package/dist/shared/{better-auth.BflsQmOZ.d.cts → better-auth.xipPt5at.d.ts} +2 -2
- package/dist/social-providers/index.cjs +7 -3
- package/dist/social-providers/index.d.cts +1 -1
- package/dist/social-providers/index.d.mts +1 -1
- package/dist/social-providers/index.d.ts +1 -1
- package/dist/social-providers/index.mjs +3 -3
- package/dist/test-utils/index.cjs +9 -8
- package/dist/test-utils/index.d.cts +94 -94
- package/dist/test-utils/index.d.mts +94 -94
- package/dist/test-utils/index.d.ts +94 -94
- package/dist/test-utils/index.mjs +9 -8
- package/dist/types/index.d.cts +3 -3
- package/dist/types/index.d.mts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/package.json +2 -1
package/dist/oauth2/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { P as ProviderOptions, O as OAuth2Tokens } from '../shared/better-auth.
|
|
2
|
-
export { a as OAuth2UserInfo, b as OAuthProvider } from '../shared/better-auth.
|
|
1
|
+
import { P as ProviderOptions, O as OAuth2Tokens } from '../shared/better-auth.CnJoIxG_.js';
|
|
2
|
+
export { a as OAuth2UserInfo, b as OAuthProvider } from '../shared/better-auth.CnJoIxG_.js';
|
|
3
3
|
import * as jose from 'jose';
|
|
4
|
-
import { p as AuthContext, G as GenericEndpointContext, U as User, O as Account } from '../shared/better-auth.
|
|
5
|
-
export { g as generateState, p as parseState } from '../shared/better-auth.
|
|
4
|
+
import { p as AuthContext, G as GenericEndpointContext, U as User, O as Account } from '../shared/better-auth.CdcdinCF.js';
|
|
5
|
+
export { g as generateState, p as parseState } from '../shared/better-auth.CnsUttgT.js';
|
|
6
6
|
import '../shared/better-auth.DTtXpZYr.js';
|
|
7
7
|
import 'zod/v4';
|
|
8
8
|
import 'kysely';
|
package/dist/oauth2/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { a as createAuthorizationCodeRequest, c as createAuthorizationURL, d as createRefreshAccessTokenRequest, i as decryptOAuthToken, h as encodeOAuthParameter, e as generateCodeChallenge, g as generateState, f as getOAuth2Tokens, j as handleOAuthUserInfo, p as parseState, r as refreshAccessToken, s as setTokenUtil, v as validateAuthorizationCode, b as validateToken } from '../shared/better-auth.
|
|
1
|
+
export { a as createAuthorizationCodeRequest, c as createAuthorizationURL, d as createRefreshAccessTokenRequest, i as decryptOAuthToken, h as encodeOAuthParameter, e as generateCodeChallenge, g as generateState, f as getOAuth2Tokens, j as handleOAuthUserInfo, p as parseState, r as refreshAccessToken, s as setTokenUtil, v as validateAuthorizationCode, b as validateToken } from '../shared/better-auth._2xnM2S3.mjs';
|
|
2
2
|
import 'zod/v4';
|
|
3
|
-
import '../shared/better-auth.
|
|
3
|
+
import '../shared/better-auth.DV5EHeYG.mjs';
|
|
4
4
|
import 'better-call';
|
|
5
5
|
import '../shared/better-auth.CW6D9eSx.mjs';
|
|
6
|
-
import '../shared/better-auth.
|
|
6
|
+
import '../shared/better-auth.UfVWArIB.mjs';
|
|
7
7
|
import '../shared/better-auth.DdzSJf-n.mjs';
|
|
8
8
|
import '../shared/better-auth.CMQ3rA-I.mjs';
|
|
9
9
|
import '@better-auth/utils/base64';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const admin = require('../../shared/better-auth.
|
|
3
|
+
const admin = require('../../shared/better-auth.BhdSraHG.cjs');
|
|
4
4
|
require('zod/v4');
|
|
5
5
|
require('better-call');
|
|
6
|
-
require('../../shared/better-auth.
|
|
7
|
-
require('../../shared/better-auth.
|
|
6
|
+
require('../../shared/better-auth.g2ow3cc2.cjs');
|
|
7
|
+
require('../../shared/better-auth.CLv80Pwz.cjs');
|
|
8
8
|
require('../../shared/better-auth.C1hdVENX.cjs');
|
|
9
|
-
require('../../shared/better-auth.
|
|
9
|
+
require('../../shared/better-auth.D5q0JUiv.cjs');
|
|
10
10
|
require('../../shared/better-auth.ANpbi45u.cjs');
|
|
11
11
|
require('../../shared/better-auth.B6fIklBU.cjs');
|
|
12
12
|
require('@better-auth/utils/base64');
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AccessControl, Role, Statements } from '../access/index.cjs';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import * as z from 'zod/v4';
|
|
4
|
-
import { I as InferOptionSchema, S as Session, U as User, G as GenericEndpointContext, H as HookEndpointContext } from '../../shared/better-auth.
|
|
4
|
+
import { I as InferOptionSchema, S as Session, U as User, G as GenericEndpointContext, H as HookEndpointContext } from '../../shared/better-auth.Otfjue7Z.cjs';
|
|
5
5
|
import '../../shared/better-auth.DTtXpZYr.cjs';
|
|
6
6
|
import 'kysely';
|
|
7
|
-
import '../../shared/better-auth.
|
|
7
|
+
import '../../shared/better-auth.BVRe9oUF.cjs';
|
|
8
8
|
import 'jose';
|
|
9
9
|
import 'zod/v4/core';
|
|
10
10
|
import 'zod';
|
|
@@ -454,7 +454,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
454
454
|
sortDirection?: "asc" | "desc" | undefined;
|
|
455
455
|
filterField?: string | undefined;
|
|
456
456
|
filterValue?: string | number | boolean | undefined;
|
|
457
|
-
filterOperator?: "
|
|
457
|
+
filterOperator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "contains" | undefined;
|
|
458
458
|
};
|
|
459
459
|
} & {
|
|
460
460
|
params?: Record<string, any>;
|
|
@@ -519,9 +519,9 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
519
519
|
filterField: z.ZodOptional<z.ZodString>;
|
|
520
520
|
filterValue: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodBoolean]>>;
|
|
521
521
|
filterOperator: z.ZodOptional<z.ZodEnum<{
|
|
522
|
-
lt: "lt";
|
|
523
522
|
eq: "eq";
|
|
524
523
|
ne: "ne";
|
|
524
|
+
lt: "lt";
|
|
525
525
|
lte: "lte";
|
|
526
526
|
gt: "gt";
|
|
527
527
|
gte: "gte";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AccessControl, Role, Statements } from '../access/index.mjs';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import * as z from 'zod/v4';
|
|
4
|
-
import { I as InferOptionSchema, S as Session, U as User, G as GenericEndpointContext, H as HookEndpointContext } from '../../shared/better-auth.
|
|
4
|
+
import { I as InferOptionSchema, S as Session, U as User, G as GenericEndpointContext, H as HookEndpointContext } from '../../shared/better-auth.D75jtXt8.mjs';
|
|
5
5
|
import '../../shared/better-auth.DTtXpZYr.mjs';
|
|
6
6
|
import 'kysely';
|
|
7
|
-
import '../../shared/better-auth.
|
|
7
|
+
import '../../shared/better-auth.efEqxJ3k.mjs';
|
|
8
8
|
import 'jose';
|
|
9
9
|
import 'zod/v4/core';
|
|
10
10
|
import 'zod';
|
|
@@ -454,7 +454,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
454
454
|
sortDirection?: "asc" | "desc" | undefined;
|
|
455
455
|
filterField?: string | undefined;
|
|
456
456
|
filterValue?: string | number | boolean | undefined;
|
|
457
|
-
filterOperator?: "
|
|
457
|
+
filterOperator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "contains" | undefined;
|
|
458
458
|
};
|
|
459
459
|
} & {
|
|
460
460
|
params?: Record<string, any>;
|
|
@@ -519,9 +519,9 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
519
519
|
filterField: z.ZodOptional<z.ZodString>;
|
|
520
520
|
filterValue: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodBoolean]>>;
|
|
521
521
|
filterOperator: z.ZodOptional<z.ZodEnum<{
|
|
522
|
-
lt: "lt";
|
|
523
522
|
eq: "eq";
|
|
524
523
|
ne: "ne";
|
|
524
|
+
lt: "lt";
|
|
525
525
|
lte: "lte";
|
|
526
526
|
gt: "gt";
|
|
527
527
|
gte: "gte";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AccessControl, Role, Statements } from '../access/index.js';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import * as z from 'zod/v4';
|
|
4
|
-
import { I as InferOptionSchema, S as Session, U as User, G as GenericEndpointContext, H as HookEndpointContext } from '../../shared/better-auth.
|
|
4
|
+
import { I as InferOptionSchema, S as Session, U as User, G as GenericEndpointContext, H as HookEndpointContext } from '../../shared/better-auth.CdcdinCF.js';
|
|
5
5
|
import '../../shared/better-auth.DTtXpZYr.js';
|
|
6
6
|
import 'kysely';
|
|
7
|
-
import '../../shared/better-auth.
|
|
7
|
+
import '../../shared/better-auth.CnJoIxG_.js';
|
|
8
8
|
import 'jose';
|
|
9
9
|
import 'zod/v4/core';
|
|
10
10
|
import 'zod';
|
|
@@ -454,7 +454,7 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
454
454
|
sortDirection?: "asc" | "desc" | undefined;
|
|
455
455
|
filterField?: string | undefined;
|
|
456
456
|
filterValue?: string | number | boolean | undefined;
|
|
457
|
-
filterOperator?: "
|
|
457
|
+
filterOperator?: "eq" | "ne" | "lt" | "lte" | "gt" | "gte" | "contains" | undefined;
|
|
458
458
|
};
|
|
459
459
|
} & {
|
|
460
460
|
params?: Record<string, any>;
|
|
@@ -519,9 +519,9 @@ declare const admin: <O extends AdminOptions>(options?: O) => {
|
|
|
519
519
|
filterField: z.ZodOptional<z.ZodString>;
|
|
520
520
|
filterValue: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodNumber]>, z.ZodBoolean]>>;
|
|
521
521
|
filterOperator: z.ZodOptional<z.ZodEnum<{
|
|
522
|
-
lt: "lt";
|
|
523
522
|
eq: "eq";
|
|
524
523
|
ne: "ne";
|
|
524
|
+
lt: "lt";
|
|
525
525
|
lte: "lte";
|
|
526
526
|
gt: "gt";
|
|
527
527
|
gte: "gte";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { a as admin } from '../../shared/better-auth.
|
|
1
|
+
export { a as admin } from '../../shared/better-auth.DX9TcqCt.mjs';
|
|
2
2
|
import 'zod/v4';
|
|
3
3
|
import 'better-call';
|
|
4
|
-
import '../../shared/better-auth.
|
|
5
|
-
import '../../shared/better-auth.
|
|
4
|
+
import '../../shared/better-auth._2xnM2S3.mjs';
|
|
5
|
+
import '../../shared/better-auth.DV5EHeYG.mjs';
|
|
6
6
|
import '../../shared/better-auth.CW6D9eSx.mjs';
|
|
7
|
-
import '../../shared/better-auth.
|
|
7
|
+
import '../../shared/better-auth.UfVWArIB.mjs';
|
|
8
8
|
import '../../shared/better-auth.DdzSJf-n.mjs';
|
|
9
9
|
import '../../shared/better-auth.CMQ3rA-I.mjs';
|
|
10
10
|
import '@better-auth/utils/base64';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const betterCall = require('better-call');
|
|
4
|
-
require('../../shared/better-auth.
|
|
5
|
-
const session = require('../../shared/better-auth.
|
|
4
|
+
require('../../shared/better-auth.g2ow3cc2.cjs');
|
|
5
|
+
const session = require('../../shared/better-auth.CLv80Pwz.cjs');
|
|
6
6
|
require('zod/v4');
|
|
7
|
-
const cookies_index = require('../../shared/better-auth.
|
|
7
|
+
const cookies_index = require('../../shared/better-auth.D5q0JUiv.cjs');
|
|
8
8
|
const schema$1 = require('../../shared/better-auth.BIMq4RPW.cjs');
|
|
9
9
|
require('../../shared/better-auth.B6fIklBU.cjs');
|
|
10
10
|
require('../../shared/better-auth.B3274wGK.cjs');
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { U as User, S as Session, p as AuthContext, I as InferOptionSchema, H as HookEndpointContext } from '../../shared/better-auth.
|
|
1
|
+
import { U as User, S as Session, p as AuthContext, I as InferOptionSchema, H as HookEndpointContext } from '../../shared/better-auth.Otfjue7Z.cjs';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import { EndpointContext } from 'better-call';
|
|
4
4
|
import 'kysely';
|
|
5
5
|
import 'zod/v4';
|
|
6
6
|
import '../../shared/better-auth.DTtXpZYr.cjs';
|
|
7
|
-
import '../../shared/better-auth.
|
|
7
|
+
import '../../shared/better-auth.BVRe9oUF.cjs';
|
|
8
8
|
import 'jose';
|
|
9
9
|
import 'zod/v4/core';
|
|
10
10
|
import 'zod';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { U as User, S as Session, p as AuthContext, I as InferOptionSchema, H as HookEndpointContext } from '../../shared/better-auth.
|
|
1
|
+
import { U as User, S as Session, p as AuthContext, I as InferOptionSchema, H as HookEndpointContext } from '../../shared/better-auth.D75jtXt8.mjs';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import { EndpointContext } from 'better-call';
|
|
4
4
|
import 'kysely';
|
|
5
5
|
import 'zod/v4';
|
|
6
6
|
import '../../shared/better-auth.DTtXpZYr.mjs';
|
|
7
|
-
import '../../shared/better-auth.
|
|
7
|
+
import '../../shared/better-auth.efEqxJ3k.mjs';
|
|
8
8
|
import 'jose';
|
|
9
9
|
import 'zod/v4/core';
|
|
10
10
|
import 'zod';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { U as User, S as Session, p as AuthContext, I as InferOptionSchema, H as HookEndpointContext } from '../../shared/better-auth.
|
|
1
|
+
import { U as User, S as Session, p as AuthContext, I as InferOptionSchema, H as HookEndpointContext } from '../../shared/better-auth.CdcdinCF.js';
|
|
2
2
|
import * as better_call from 'better-call';
|
|
3
3
|
import { EndpointContext } from 'better-call';
|
|
4
4
|
import 'kysely';
|
|
5
5
|
import 'zod/v4';
|
|
6
6
|
import '../../shared/better-auth.DTtXpZYr.js';
|
|
7
|
-
import '../../shared/better-auth.
|
|
7
|
+
import '../../shared/better-auth.CnJoIxG_.js';
|
|
8
8
|
import 'jose';
|
|
9
9
|
import 'zod/v4/core';
|
|
10
10
|
import 'zod';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { APIError } from 'better-call';
|
|
2
|
-
import '../../shared/better-auth.
|
|
3
|
-
import { c as createAuthMiddleware, a as createAuthEndpoint, g as getSessionFromCtx } from '../../shared/better-auth.
|
|
2
|
+
import '../../shared/better-auth._2xnM2S3.mjs';
|
|
3
|
+
import { c as createAuthMiddleware, a as createAuthEndpoint, g as getSessionFromCtx } from '../../shared/better-auth.DV5EHeYG.mjs';
|
|
4
4
|
import 'zod/v4';
|
|
5
|
-
import { p as parseSetCookieHeader, s as setSessionCookie } from '../../shared/better-auth.
|
|
5
|
+
import { p as parseSetCookieHeader, s as setSessionCookie } from '../../shared/better-auth.UfVWArIB.mjs';
|
|
6
6
|
import { m as mergeSchema } from '../../shared/better-auth.n2KFGwjY.mjs';
|
|
7
7
|
import '../../shared/better-auth.CMQ3rA-I.mjs';
|
|
8
8
|
import '../../shared/better-auth.BjBlybv-.mjs';
|
|
@@ -6,9 +6,9 @@ require('@better-auth/utils/base64');
|
|
|
6
6
|
const hmac = require('@better-auth/utils/hmac');
|
|
7
7
|
require('../../shared/better-auth.B3274wGK.cjs');
|
|
8
8
|
require('@better-auth/utils/binary');
|
|
9
|
-
const cookies_index = require('../../shared/better-auth.
|
|
10
|
-
require('../../shared/better-auth.
|
|
11
|
-
const session = require('../../shared/better-auth.
|
|
9
|
+
const cookies_index = require('../../shared/better-auth.D5q0JUiv.cjs');
|
|
10
|
+
require('../../shared/better-auth.g2ow3cc2.cjs');
|
|
11
|
+
const session = require('../../shared/better-auth.CLv80Pwz.cjs');
|
|
12
12
|
require('zod/v4');
|
|
13
13
|
require('../../shared/better-auth.BIMq4RPW.cjs');
|
|
14
14
|
require('../../shared/better-auth.ANpbi45u.cjs');
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
|
-
import { H as HookEndpointContext } from '../../shared/better-auth.
|
|
2
|
+
import { H as HookEndpointContext } from '../../shared/better-auth.Otfjue7Z.cjs';
|
|
3
3
|
import 'kysely';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.DTtXpZYr.cjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.BVRe9oUF.cjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
|
-
import { H as HookEndpointContext } from '../../shared/better-auth.
|
|
2
|
+
import { H as HookEndpointContext } from '../../shared/better-auth.D75jtXt8.mjs';
|
|
3
3
|
import 'kysely';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.DTtXpZYr.mjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.efEqxJ3k.mjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
|
-
import { H as HookEndpointContext } from '../../shared/better-auth.
|
|
2
|
+
import { H as HookEndpointContext } from '../../shared/better-auth.CdcdinCF.js';
|
|
3
3
|
import 'kysely';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.DTtXpZYr.js';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.CnJoIxG_.js';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -4,9 +4,9 @@ import '@better-auth/utils/base64';
|
|
|
4
4
|
import { createHMAC } from '@better-auth/utils/hmac';
|
|
5
5
|
import '../../shared/better-auth.BjBlybv-.mjs';
|
|
6
6
|
import '@better-auth/utils/binary';
|
|
7
|
-
import { p as parseSetCookieHeader } from '../../shared/better-auth.
|
|
8
|
-
import '../../shared/better-auth.
|
|
9
|
-
import { c as createAuthMiddleware } from '../../shared/better-auth.
|
|
7
|
+
import { p as parseSetCookieHeader } from '../../shared/better-auth.UfVWArIB.mjs';
|
|
8
|
+
import '../../shared/better-auth._2xnM2S3.mjs';
|
|
9
|
+
import { c as createAuthMiddleware } from '../../shared/better-auth.DV5EHeYG.mjs';
|
|
10
10
|
import 'zod/v4';
|
|
11
11
|
import '../../shared/better-auth.n2KFGwjY.mjs';
|
|
12
12
|
import '../../shared/better-auth.DdzSJf-n.mjs';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as AuthContext } from '../../shared/better-auth.
|
|
1
|
+
import { p as AuthContext } from '../../shared/better-auth.Otfjue7Z.cjs';
|
|
2
2
|
import 'kysely';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.DTtXpZYr.cjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.BVRe9oUF.cjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as AuthContext } from '../../shared/better-auth.
|
|
1
|
+
import { p as AuthContext } from '../../shared/better-auth.D75jtXt8.mjs';
|
|
2
2
|
import 'kysely';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.DTtXpZYr.mjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.efEqxJ3k.mjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as AuthContext } from '../../shared/better-auth.
|
|
1
|
+
import { p as AuthContext } from '../../shared/better-auth.CdcdinCF.js';
|
|
2
2
|
import 'kysely';
|
|
3
3
|
import 'better-call';
|
|
4
4
|
import 'zod/v4';
|
|
5
5
|
import '../../shared/better-auth.DTtXpZYr.js';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.CnJoIxG_.js';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
const z = require('zod/v4');
|
|
4
4
|
require('better-call');
|
|
5
|
-
require('../../shared/better-auth.
|
|
6
|
-
const session = require('../../shared/better-auth.
|
|
5
|
+
require('../../shared/better-auth.g2ow3cc2.cjs');
|
|
6
|
+
const session = require('../../shared/better-auth.CLv80Pwz.cjs');
|
|
7
7
|
require('../../shared/better-auth.B6fIklBU.cjs');
|
|
8
8
|
require('@better-auth/utils/base64');
|
|
9
9
|
require('@better-auth/utils/hmac');
|
|
10
10
|
require('../../shared/better-auth.B3274wGK.cjs');
|
|
11
11
|
require('@better-auth/utils/binary');
|
|
12
12
|
require('../../shared/better-auth.BIMq4RPW.cjs');
|
|
13
|
+
const pluginHelper = require('../../shared/better-auth.DNqtHmvg.cjs');
|
|
13
14
|
require('../../shared/better-auth.C1hdVENX.cjs');
|
|
14
15
|
require('@better-auth/utils/hash');
|
|
15
16
|
require('../../crypto/index.cjs');
|
|
@@ -26,7 +27,7 @@ require('../../shared/better-auth.CYeOI8C-.cjs');
|
|
|
26
27
|
require('@better-auth/utils/random');
|
|
27
28
|
require('@better-fetch/fetch');
|
|
28
29
|
require('../../shared/better-auth.DRmln2Nr.cjs');
|
|
29
|
-
require('../../shared/better-auth.
|
|
30
|
+
require('../../shared/better-auth.D5q0JUiv.cjs');
|
|
30
31
|
require('../../shared/better-auth.vPQBmXQL.cjs');
|
|
31
32
|
require('jose/errors');
|
|
32
33
|
require('../../shared/better-auth.Bg6iw3ig.cjs');
|
|
@@ -60,9 +61,24 @@ const getSessionQuerySchema = z__namespace.optional(
|
|
|
60
61
|
}).optional()
|
|
61
62
|
})
|
|
62
63
|
);
|
|
63
|
-
const customSession = (fn, options) => {
|
|
64
|
+
const customSession = (fn, options, pluginOptions) => {
|
|
64
65
|
return {
|
|
65
66
|
id: "custom-session",
|
|
67
|
+
hooks: {
|
|
68
|
+
after: [
|
|
69
|
+
{
|
|
70
|
+
matcher: (ctx) => ctx.path === "/multi-session/list-device-sessions" && (pluginOptions?.shouldMutateListDeviceSessionsEndpoint ?? false),
|
|
71
|
+
handler: session.createAuthMiddleware(async (ctx) => {
|
|
72
|
+
const response = await pluginHelper.getEndpointResponse(ctx);
|
|
73
|
+
if (!response) return;
|
|
74
|
+
const newResponse = await Promise.all(
|
|
75
|
+
response.map(async (v) => await fn(v, ctx))
|
|
76
|
+
);
|
|
77
|
+
return ctx.json(newResponse);
|
|
78
|
+
})
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
66
82
|
endpoints: {
|
|
67
83
|
getSession: session.createAuthEndpoint(
|
|
68
84
|
"/get-session",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
|
+
import { B as BetterAuthOptions, q as InferUser, r as InferSession, G as GenericEndpointContext, H as HookEndpointContext } from '../../shared/better-auth.Otfjue7Z.cjs';
|
|
2
3
|
import * as z from 'zod/v4';
|
|
3
|
-
import { B as BetterAuthOptions, q as InferUser, r as InferSession, G as GenericEndpointContext } from '../../shared/better-auth.CWKgK_p2.cjs';
|
|
4
4
|
import 'kysely';
|
|
5
5
|
import '../../shared/better-auth.DTtXpZYr.cjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.BVRe9oUF.cjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -11,11 +11,24 @@ import 'better-sqlite3';
|
|
|
11
11
|
import 'bun:sqlite';
|
|
12
12
|
import 'node:sqlite';
|
|
13
13
|
|
|
14
|
+
type CustomSessionPluginOptions = {
|
|
15
|
+
/**
|
|
16
|
+
* This option is used to determine if the list-device-sessions endpoint should be mutated to the custom session data.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
shouldMutateListDeviceSessionsEndpoint?: boolean;
|
|
20
|
+
};
|
|
14
21
|
declare const customSession: <Returns extends Record<string, any>, O extends BetterAuthOptions = BetterAuthOptions>(fn: (session: {
|
|
15
22
|
user: InferUser<O>;
|
|
16
23
|
session: InferSession<O>;
|
|
17
|
-
}, ctx: GenericEndpointContext) => Promise<Returns>, options?: O) => {
|
|
24
|
+
}, ctx: GenericEndpointContext) => Promise<Returns>, options?: O, pluginOptions?: CustomSessionPluginOptions) => {
|
|
18
25
|
id: "custom-session";
|
|
26
|
+
hooks: {
|
|
27
|
+
after: {
|
|
28
|
+
matcher: (ctx: HookEndpointContext) => boolean;
|
|
29
|
+
handler: (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<Awaited<Returns>[] | undefined>;
|
|
30
|
+
}[];
|
|
31
|
+
};
|
|
19
32
|
endpoints: {
|
|
20
33
|
getSession: {
|
|
21
34
|
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
|
|
@@ -83,3 +96,4 @@ declare const customSession: <Returns extends Record<string, any>, O extends Bet
|
|
|
83
96
|
};
|
|
84
97
|
|
|
85
98
|
export { customSession };
|
|
99
|
+
export type { CustomSessionPluginOptions };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
|
+
import { B as BetterAuthOptions, q as InferUser, r as InferSession, G as GenericEndpointContext, H as HookEndpointContext } from '../../shared/better-auth.D75jtXt8.mjs';
|
|
2
3
|
import * as z from 'zod/v4';
|
|
3
|
-
import { B as BetterAuthOptions, q as InferUser, r as InferSession, G as GenericEndpointContext } from '../../shared/better-auth.B1puuIwv.mjs';
|
|
4
4
|
import 'kysely';
|
|
5
5
|
import '../../shared/better-auth.DTtXpZYr.mjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.efEqxJ3k.mjs';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -11,11 +11,24 @@ import 'better-sqlite3';
|
|
|
11
11
|
import 'bun:sqlite';
|
|
12
12
|
import 'node:sqlite';
|
|
13
13
|
|
|
14
|
+
type CustomSessionPluginOptions = {
|
|
15
|
+
/**
|
|
16
|
+
* This option is used to determine if the list-device-sessions endpoint should be mutated to the custom session data.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
shouldMutateListDeviceSessionsEndpoint?: boolean;
|
|
20
|
+
};
|
|
14
21
|
declare const customSession: <Returns extends Record<string, any>, O extends BetterAuthOptions = BetterAuthOptions>(fn: (session: {
|
|
15
22
|
user: InferUser<O>;
|
|
16
23
|
session: InferSession<O>;
|
|
17
|
-
}, ctx: GenericEndpointContext) => Promise<Returns>, options?: O) => {
|
|
24
|
+
}, ctx: GenericEndpointContext) => Promise<Returns>, options?: O, pluginOptions?: CustomSessionPluginOptions) => {
|
|
18
25
|
id: "custom-session";
|
|
26
|
+
hooks: {
|
|
27
|
+
after: {
|
|
28
|
+
matcher: (ctx: HookEndpointContext) => boolean;
|
|
29
|
+
handler: (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<Awaited<Returns>[] | undefined>;
|
|
30
|
+
}[];
|
|
31
|
+
};
|
|
19
32
|
endpoints: {
|
|
20
33
|
getSession: {
|
|
21
34
|
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
|
|
@@ -83,3 +96,4 @@ declare const customSession: <Returns extends Record<string, any>, O extends Bet
|
|
|
83
96
|
};
|
|
84
97
|
|
|
85
98
|
export { customSession };
|
|
99
|
+
export type { CustomSessionPluginOptions };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
|
+
import { B as BetterAuthOptions, q as InferUser, r as InferSession, G as GenericEndpointContext, H as HookEndpointContext } from '../../shared/better-auth.CdcdinCF.js';
|
|
2
3
|
import * as z from 'zod/v4';
|
|
3
|
-
import { B as BetterAuthOptions, q as InferUser, r as InferSession, G as GenericEndpointContext } from '../../shared/better-auth.D_zuKEZs.js';
|
|
4
4
|
import 'kysely';
|
|
5
5
|
import '../../shared/better-auth.DTtXpZYr.js';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.CnJoIxG_.js';
|
|
7
7
|
import 'jose';
|
|
8
8
|
import 'zod/v4/core';
|
|
9
9
|
import 'zod';
|
|
@@ -11,11 +11,24 @@ import 'better-sqlite3';
|
|
|
11
11
|
import 'bun:sqlite';
|
|
12
12
|
import 'node:sqlite';
|
|
13
13
|
|
|
14
|
+
type CustomSessionPluginOptions = {
|
|
15
|
+
/**
|
|
16
|
+
* This option is used to determine if the list-device-sessions endpoint should be mutated to the custom session data.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
shouldMutateListDeviceSessionsEndpoint?: boolean;
|
|
20
|
+
};
|
|
14
21
|
declare const customSession: <Returns extends Record<string, any>, O extends BetterAuthOptions = BetterAuthOptions>(fn: (session: {
|
|
15
22
|
user: InferUser<O>;
|
|
16
23
|
session: InferSession<O>;
|
|
17
|
-
}, ctx: GenericEndpointContext) => Promise<Returns>, options?: O) => {
|
|
24
|
+
}, ctx: GenericEndpointContext) => Promise<Returns>, options?: O, pluginOptions?: CustomSessionPluginOptions) => {
|
|
18
25
|
id: "custom-session";
|
|
26
|
+
hooks: {
|
|
27
|
+
after: {
|
|
28
|
+
matcher: (ctx: HookEndpointContext) => boolean;
|
|
29
|
+
handler: (inputContext: better_call.MiddlewareInputContext<better_call.MiddlewareOptions>) => Promise<Awaited<Returns>[] | undefined>;
|
|
30
|
+
}[];
|
|
31
|
+
};
|
|
19
32
|
endpoints: {
|
|
20
33
|
getSession: {
|
|
21
34
|
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0: {
|
|
@@ -83,3 +96,4 @@ declare const customSession: <Returns extends Record<string, any>, O extends Bet
|
|
|
83
96
|
};
|
|
84
97
|
|
|
85
98
|
export { customSession };
|
|
99
|
+
export type { CustomSessionPluginOptions };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import * as z from 'zod/v4';
|
|
2
2
|
import 'better-call';
|
|
3
|
-
import '../../shared/better-auth.
|
|
4
|
-
import { a as createAuthEndpoint, b as getSession } from '../../shared/better-auth.
|
|
3
|
+
import '../../shared/better-auth._2xnM2S3.mjs';
|
|
4
|
+
import { a as createAuthEndpoint, c as createAuthMiddleware, b as getSession } from '../../shared/better-auth.DV5EHeYG.mjs';
|
|
5
5
|
import '../../shared/better-auth.CMQ3rA-I.mjs';
|
|
6
6
|
import '@better-auth/utils/base64';
|
|
7
7
|
import '@better-auth/utils/hmac';
|
|
8
8
|
import '../../shared/better-auth.BjBlybv-.mjs';
|
|
9
9
|
import '@better-auth/utils/binary';
|
|
10
10
|
import '../../shared/better-auth.n2KFGwjY.mjs';
|
|
11
|
+
import { g as getEndpointResponse } from '../../shared/better-auth.DQI8AD7d.mjs';
|
|
11
12
|
import '../../shared/better-auth.CW6D9eSx.mjs';
|
|
12
13
|
import '@better-auth/utils/hash';
|
|
13
14
|
import '../../crypto/index.mjs';
|
|
@@ -24,7 +25,7 @@ import '../../shared/better-auth.B4Qoxdgc.mjs';
|
|
|
24
25
|
import '@better-auth/utils/random';
|
|
25
26
|
import '@better-fetch/fetch';
|
|
26
27
|
import '../../shared/better-auth.CuS_eDdK.mjs';
|
|
27
|
-
import '../../shared/better-auth.
|
|
28
|
+
import '../../shared/better-auth.UfVWArIB.mjs';
|
|
28
29
|
import '../../shared/better-auth.BZZKN1g7.mjs';
|
|
29
30
|
import 'jose/errors';
|
|
30
31
|
import '../../shared/better-auth.BUPPRXfK.mjs';
|
|
@@ -44,9 +45,24 @@ const getSessionQuerySchema = z.optional(
|
|
|
44
45
|
}).optional()
|
|
45
46
|
})
|
|
46
47
|
);
|
|
47
|
-
const customSession = (fn, options) => {
|
|
48
|
+
const customSession = (fn, options, pluginOptions) => {
|
|
48
49
|
return {
|
|
49
50
|
id: "custom-session",
|
|
51
|
+
hooks: {
|
|
52
|
+
after: [
|
|
53
|
+
{
|
|
54
|
+
matcher: (ctx) => ctx.path === "/multi-session/list-device-sessions" && (pluginOptions?.shouldMutateListDeviceSessionsEndpoint ?? false),
|
|
55
|
+
handler: createAuthMiddleware(async (ctx) => {
|
|
56
|
+
const response = await getEndpointResponse(ctx);
|
|
57
|
+
if (!response) return;
|
|
58
|
+
const newResponse = await Promise.all(
|
|
59
|
+
response.map(async (v) => await fn(v, ctx))
|
|
60
|
+
);
|
|
61
|
+
return ctx.json(newResponse);
|
|
62
|
+
})
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
50
66
|
endpoints: {
|
|
51
67
|
getSession: createAuthEndpoint(
|
|
52
68
|
"/get-session",
|