better-auth 1.4.0-beta.1 → 1.4.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/index.d.cts +2 -2
- package/dist/adapters/index.d.mts +2 -2
- package/dist/adapters/index.d.ts +2 -2
- 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 +1 -1
- 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 +2 -2
- package/dist/client/index.cjs +2 -2
- package/dist/client/index.d.cts +3 -3
- package/dist/client/index.d.mts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.mjs +2 -2
- package/dist/client/plugins/index.cjs +1 -4
- package/dist/client/plugins/index.d.cts +3 -5
- package/dist/client/plugins/index.d.mts +3 -5
- package/dist/client/plugins/index.d.ts +3 -5
- package/dist/client/plugins/index.mjs +1 -4
- package/dist/client/react/index.cjs +1 -1
- package/dist/client/react/index.d.cts +5 -5
- package/dist/client/react/index.d.mts +5 -5
- package/dist/client/react/index.d.ts +5 -5
- package/dist/client/react/index.mjs +1 -1
- package/dist/client/solid/index.cjs +1 -1
- package/dist/client/solid/index.d.cts +5 -5
- package/dist/client/solid/index.d.mts +5 -5
- package/dist/client/solid/index.d.ts +5 -5
- package/dist/client/solid/index.mjs +1 -1
- package/dist/client/svelte/index.cjs +1 -1
- package/dist/client/svelte/index.d.cts +5 -5
- package/dist/client/svelte/index.d.mts +5 -5
- package/dist/client/svelte/index.d.ts +5 -5
- package/dist/client/svelte/index.mjs +1 -1
- package/dist/client/vue/index.cjs +1 -1
- package/dist/client/vue/index.d.cts +5 -5
- package/dist/client/vue/index.d.mts +5 -5
- package/dist/client/vue/index.d.ts +5 -5
- package/dist/client/vue/index.mjs +1 -1
- 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/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 +3 -3
- package/dist/index.d.cts +4 -4
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.mjs +3 -3
- package/dist/integrations/next-js.cjs +2 -2
- 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 +2 -2
- 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/react-start.cjs +2 -2
- package/dist/integrations/react-start.d.cts +1 -1
- package/dist/integrations/react-start.d.mts +1 -1
- package/dist/integrations/react-start.d.ts +1 -1
- package/dist/integrations/react-start.mjs +2 -2
- package/dist/integrations/svelte-kit.cjs +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/integrations/svelte-kit.mjs +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 +2 -2
- 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 +2 -2
- package/dist/plugins/anonymous/index.cjs +1 -1
- 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 +1 -1
- package/dist/plugins/bearer/index.cjs +1 -1
- 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 +1 -1
- package/dist/plugins/captcha/index.d.cts +1 -1
- package/dist/plugins/captcha/index.d.mts +1 -1
- package/dist/plugins/captcha/index.d.ts +1 -1
- package/dist/plugins/custom-session/index.cjs +1 -1
- 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 +1 -1
- package/dist/plugins/device-authorization/index.d.cts +1 -1
- package/dist/plugins/device-authorization/index.d.mts +1 -1
- package/dist/plugins/device-authorization/index.d.ts +1 -1
- package/dist/plugins/email-otp/index.cjs +1 -1
- 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 +1 -1
- package/dist/plugins/generic-oauth/index.cjs +1 -1
- 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 +1 -1
- package/dist/plugins/haveibeenpwned/index.cjs +1 -1
- package/dist/plugins/haveibeenpwned/index.d.cts +1 -1
- package/dist/plugins/haveibeenpwned/index.d.mts +1 -1
- package/dist/plugins/haveibeenpwned/index.d.ts +1 -1
- package/dist/plugins/haveibeenpwned/index.mjs +1 -1
- package/dist/plugins/index.cjs +7 -6
- 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 +8 -7
- package/dist/plugins/jwt/index.cjs +1 -1
- 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 +1 -1
- package/dist/plugins/magic-link/index.cjs +1 -1
- package/dist/plugins/magic-link/index.mjs +1 -1
- package/dist/plugins/multi-session/index.cjs +1 -1
- 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 +1 -1
- package/dist/plugins/oauth-proxy/index.cjs +1 -1
- 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 +1 -1
- package/dist/plugins/oidc-provider/index.cjs +2 -2
- package/dist/plugins/oidc-provider/index.d.cts +1 -1
- package/dist/plugins/oidc-provider/index.d.mts +1 -1
- package/dist/plugins/oidc-provider/index.d.ts +1 -1
- package/dist/plugins/oidc-provider/index.mjs +2 -2
- package/dist/plugins/one-tap/index.cjs +1 -1
- package/dist/plugins/one-tap/index.mjs +1 -1
- package/dist/plugins/one-time-token/index.cjs +3 -3
- package/dist/plugins/one-time-token/index.d.cts +1 -1
- package/dist/plugins/one-time-token/index.d.mts +1 -1
- package/dist/plugins/one-time-token/index.d.ts +1 -1
- package/dist/plugins/one-time-token/index.mjs +3 -3
- package/dist/plugins/open-api/index.cjs +1 -1
- 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 +1 -1
- package/dist/plugins/organization/index.cjs +3 -3
- package/dist/plugins/organization/index.d.cts +1 -1
- package/dist/plugins/organization/index.d.mts +1 -1
- package/dist/plugins/organization/index.d.ts +1 -1
- package/dist/plugins/organization/index.mjs +3 -3
- package/dist/plugins/passkey/index.cjs +4 -9
- package/dist/plugins/passkey/index.d.cts +3 -8
- package/dist/plugins/passkey/index.d.mts +3 -8
- package/dist/plugins/passkey/index.d.ts +3 -8
- package/dist/plugins/passkey/index.mjs +4 -9
- package/dist/plugins/phone-number/index.cjs +1 -1
- package/dist/plugins/phone-number/index.d.cts +1 -1
- package/dist/plugins/phone-number/index.d.mts +1 -1
- package/dist/plugins/phone-number/index.d.ts +1 -1
- package/dist/plugins/phone-number/index.mjs +1 -1
- package/dist/plugins/siwe/index.cjs +1 -1
- package/dist/plugins/siwe/index.d.cts +1 -1
- package/dist/plugins/siwe/index.d.mts +1 -1
- package/dist/plugins/siwe/index.d.ts +1 -1
- package/dist/plugins/siwe/index.mjs +1 -1
- package/dist/plugins/sso/index.cjs +1 -1
- 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 +1 -1
- package/dist/plugins/two-factor/index.cjs +1 -1
- 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 +1 -1
- package/dist/plugins/username/index.cjs +24 -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 +24 -3
- package/dist/shared/{better-auth.DU-jrbrJ.mjs → better-auth.-8Mk4DBL.mjs} +1 -1
- package/dist/shared/{better-auth.CszjuPqX.cjs → better-auth.1YBeofpK.cjs} +2 -2
- package/dist/shared/{better-auth.C6XqSToF.mjs → better-auth.3naUdTMW.mjs} +1 -1
- package/dist/shared/{better-auth.Dp3TDU01.cjs → better-auth.B7A2AeSg.cjs} +2 -2
- package/dist/shared/{better-auth.C0eUWmDH.cjs → better-auth.BDdoXh_7.cjs} +6 -1
- package/dist/shared/{better-auth.CwXs-abq.d.ts → better-auth.BLORa3vY.d.ts} +1 -1
- package/dist/shared/{better-auth.BpnW3Y7U.d.ts → better-auth.BQv0wGSb.d.ts} +16 -12
- package/dist/shared/{better-auth.B3bZoclS.d.mts → better-auth.B_xbPKKL.d.mts} +16 -12
- package/dist/shared/{better-auth.DNOixpmw.d.mts → better-auth.Bbkp5JKM.d.mts} +1 -1
- package/dist/shared/{better-auth.4_1BfAo1.cjs → better-auth.BkcRiga0.cjs} +1 -1
- package/dist/shared/{better-auth.4EzI70WC.mjs → better-auth.C1TnI_Rz.mjs} +3 -1
- package/dist/shared/{better-auth.BIcpessK.d.cts → better-auth.CLmuULOM.d.cts} +16 -12
- package/dist/shared/{better-auth.DFFLg_0h.mjs → better-auth.CV6SLN2A.mjs} +1 -1
- package/dist/shared/{better-auth.BKhlUl4L.mjs → better-auth.CnD_hzZ_.mjs} +2 -2
- package/dist/shared/{better-auth.BK2FHZMq.d.mts → better-auth.CreeZQ__.d.mts} +1 -1
- package/dist/shared/{better-auth.B5_hCdeH.cjs → better-auth.CvVm_hFg.cjs} +1 -1
- package/dist/shared/{better-auth.BgUht1zc.cjs → better-auth.CveVqL58.cjs} +1 -1
- package/dist/shared/{better-auth.T_KylejJ.d.cts → better-auth.CxLMKBFr.d.cts} +1 -1
- package/dist/shared/{better-auth.BF7a6yeC.d.ts → better-auth.DBmu12iE.d.ts} +1 -1
- package/dist/shared/{better-auth.B_r2AcFE.cjs → better-auth.DIAGL28F.cjs} +1 -1
- package/dist/shared/{better-auth.PwYG2bh2.cjs → better-auth.DIPz2ymP.cjs} +3 -1
- package/dist/shared/{better-auth.SCAGFnmj.mjs → better-auth.DL8idXrv.mjs} +1 -1
- package/dist/shared/{better-auth.D2Ya06I8.mjs → better-auth.DWm9SJv0.mjs} +2 -2
- package/dist/shared/{better-auth.DFAe0eEY.d.mts → better-auth.DabBNJnG.d.mts} +1 -1
- package/dist/shared/{better-auth.Dfaw6tuq.d.cts → better-auth.DqKvGWll.d.cts} +1 -1
- package/dist/shared/{better-auth.C4cxDzG3.mjs → better-auth.DsRTWTq9.mjs} +6 -1
- package/dist/shared/{better-auth.CREk28fc.mjs → better-auth.Dx5-aWCB.mjs} +1 -1
- package/dist/shared/{better-auth.CT1UdMDg.d.ts → better-auth.XB1l7SdM.d.ts} +1 -1
- package/dist/shared/{better-auth.CVJiT-QN.mjs → better-auth.aytbwQG-.mjs} +31 -20
- package/dist/shared/{better-auth.BXsMSpax.cjs → better-auth.b3V1DCfW.cjs} +31 -20
- package/dist/shared/{better-auth.zNVyHBMf.d.cts → better-auth.gfiicitY.d.cts} +1 -1
- package/dist/shared/{better-auth.CTOuNmcf.cjs → better-auth.owJK4RTO.cjs} +1 -1
- package/dist/social-providers/index.cjs +1 -1
- package/dist/social-providers/index.mjs +1 -1
- package/dist/test-utils/index.cjs +6 -6
- package/dist/test-utils/index.d.cts +2 -2
- package/dist/test-utils/index.d.mts +2 -2
- package/dist/test-utils/index.d.ts +2 -2
- package/dist/test-utils/index.mjs +6 -6
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@ import * as _simplewebauthn_server from '@simplewebauthn/server';
|
|
|
2
2
|
import { CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON, AuthenticationResponseJSON } from '@simplewebauthn/server';
|
|
3
3
|
import * as better_call from 'better-call';
|
|
4
4
|
import * as z from 'zod';
|
|
5
|
-
import { I as InferOptionSchema } from '../../shared/better-auth.
|
|
5
|
+
import { I as InferOptionSchema } from '../../shared/better-auth.B_xbPKKL.mjs';
|
|
6
6
|
import 'kysely';
|
|
7
7
|
import '../../shared/better-auth.BHPr8J54.mjs';
|
|
8
8
|
import '../../shared/better-auth.DTtXpZYr.mjs';
|
|
@@ -33,7 +33,7 @@ interface PasskeyOptions {
|
|
|
33
33
|
* if this isn't provided. The client itself will
|
|
34
34
|
* pass this value.
|
|
35
35
|
*/
|
|
36
|
-
origin?: string | null;
|
|
36
|
+
origin?: string | string[] | null;
|
|
37
37
|
/**
|
|
38
38
|
* Allow customization of the authenticatorSelection options
|
|
39
39
|
* during passkey registration.
|
|
@@ -250,9 +250,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
250
250
|
};
|
|
251
251
|
generatePasskeyAuthenticationOptions: {
|
|
252
252
|
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0?: ({
|
|
253
|
-
body?:
|
|
254
|
-
email?: string | undefined;
|
|
255
|
-
} | undefined;
|
|
253
|
+
body?: undefined;
|
|
256
254
|
} & {
|
|
257
255
|
method?: "POST" | undefined;
|
|
258
256
|
} & {
|
|
@@ -277,9 +275,6 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
277
275
|
} : _simplewebauthn_server.PublicKeyCredentialRequestOptionsJSON>;
|
|
278
276
|
options: {
|
|
279
277
|
method: "POST";
|
|
280
|
-
body: z.ZodOptional<z.ZodObject<{
|
|
281
|
-
email: z.ZodOptional<z.ZodString>;
|
|
282
|
-
}, z.core.$strip>>;
|
|
283
278
|
metadata: {
|
|
284
279
|
openapi: {
|
|
285
280
|
description: string;
|
|
@@ -2,7 +2,7 @@ import * as _simplewebauthn_server from '@simplewebauthn/server';
|
|
|
2
2
|
import { CredentialDeviceType, PublicKeyCredentialCreationOptionsJSON, AuthenticationResponseJSON } from '@simplewebauthn/server';
|
|
3
3
|
import * as better_call from 'better-call';
|
|
4
4
|
import * as z from 'zod';
|
|
5
|
-
import { I as InferOptionSchema } from '../../shared/better-auth.
|
|
5
|
+
import { I as InferOptionSchema } from '../../shared/better-auth.BQv0wGSb.js';
|
|
6
6
|
import 'kysely';
|
|
7
7
|
import '../../shared/better-auth.C6qXK08w.js';
|
|
8
8
|
import '../../shared/better-auth.DTtXpZYr.js';
|
|
@@ -33,7 +33,7 @@ interface PasskeyOptions {
|
|
|
33
33
|
* if this isn't provided. The client itself will
|
|
34
34
|
* pass this value.
|
|
35
35
|
*/
|
|
36
|
-
origin?: string | null;
|
|
36
|
+
origin?: string | string[] | null;
|
|
37
37
|
/**
|
|
38
38
|
* Allow customization of the authenticatorSelection options
|
|
39
39
|
* during passkey registration.
|
|
@@ -250,9 +250,7 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
250
250
|
};
|
|
251
251
|
generatePasskeyAuthenticationOptions: {
|
|
252
252
|
<AsResponse extends boolean = false, ReturnHeaders extends boolean = false>(inputCtx_0?: ({
|
|
253
|
-
body?:
|
|
254
|
-
email?: string | undefined;
|
|
255
|
-
} | undefined;
|
|
253
|
+
body?: undefined;
|
|
256
254
|
} & {
|
|
257
255
|
method?: "POST" | undefined;
|
|
258
256
|
} & {
|
|
@@ -277,9 +275,6 @@ declare const passkey: (options?: PasskeyOptions) => {
|
|
|
277
275
|
} : _simplewebauthn_server.PublicKeyCredentialRequestOptionsJSON>;
|
|
278
276
|
options: {
|
|
279
277
|
method: "POST";
|
|
280
|
-
body: z.ZodOptional<z.ZodObject<{
|
|
281
|
-
email: z.ZodOptional<z.ZodString>;
|
|
282
|
-
}, z.core.$strip>>;
|
|
283
278
|
metadata: {
|
|
284
279
|
openapi: {
|
|
285
280
|
description: string;
|
|
@@ -3,7 +3,7 @@ import { APIError } from 'better-call';
|
|
|
3
3
|
import { g as generateRandomString } from '../../shared/better-auth.B4Qoxdgc.mjs';
|
|
4
4
|
import * as z from 'zod';
|
|
5
5
|
import { a as createAuthEndpoint, s as sessionMiddleware, f as freshSessionMiddleware, g as getSessionFromCtx } from '../../shared/better-auth.CBY7cUGy.mjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.DsRTWTq9.mjs';
|
|
7
7
|
import { s as setSessionCookie } from '../../shared/better-auth.fV_ra52g.mjs';
|
|
8
8
|
import { m as mergeSchema } from '../../shared/better-auth.Dlh8OCID.mjs';
|
|
9
9
|
import '../../shared/better-auth.CiuwFiHM.mjs';
|
|
@@ -77,13 +77,13 @@ const passkey = (options) => {
|
|
|
77
77
|
parameters: {
|
|
78
78
|
query: {
|
|
79
79
|
authenticatorAttachment: {
|
|
80
|
-
description: `Type of authenticator to use for registration.
|
|
81
|
-
"platform" for device-specific authenticators,
|
|
80
|
+
description: `Type of authenticator to use for registration.
|
|
81
|
+
"platform" for device-specific authenticators,
|
|
82
82
|
"cross-platform" for authenticators that can be used across devices.`,
|
|
83
83
|
required: false
|
|
84
84
|
},
|
|
85
85
|
name: {
|
|
86
|
-
description: `Optional custom name for the passkey.
|
|
86
|
+
description: `Optional custom name for the passkey.
|
|
87
87
|
This can help identify the passkey when managing multiple credentials.`,
|
|
88
88
|
required: false
|
|
89
89
|
}
|
|
@@ -260,11 +260,6 @@ const passkey = (options) => {
|
|
|
260
260
|
"/passkey/generate-authenticate-options",
|
|
261
261
|
{
|
|
262
262
|
method: "POST",
|
|
263
|
-
body: z.object({
|
|
264
|
-
email: z.string().meta({
|
|
265
|
-
description: "The email address of the user"
|
|
266
|
-
}).optional()
|
|
267
|
-
}).optional(),
|
|
268
263
|
metadata: {
|
|
269
264
|
openapi: {
|
|
270
265
|
description: "Generate authentication options for a passkey",
|
|
@@ -5,7 +5,7 @@ const session = require('../../shared/better-auth.CAcHGnwq.cjs');
|
|
|
5
5
|
const betterCall = require('better-call');
|
|
6
6
|
const schema$1 = require('../../shared/better-auth.CX8orviF.cjs');
|
|
7
7
|
const random = require('../../shared/better-auth.CYeOI8C-.cjs');
|
|
8
|
-
require('../../shared/better-auth.
|
|
8
|
+
require('../../shared/better-auth.BDdoXh_7.cjs');
|
|
9
9
|
const cookies_index = require('../../shared/better-auth.CXM9s0dx.cjs');
|
|
10
10
|
require('../../shared/better-auth.B6fIklBU.cjs');
|
|
11
11
|
require('../../shared/better-auth.DTvRBuq4.cjs');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
-
import { U as User, I as InferOptionSchema } from '../../shared/better-auth.
|
|
3
|
+
import { U as User, I as InferOptionSchema } from '../../shared/better-auth.CLmuULOM.cjs';
|
|
4
4
|
import 'kysely';
|
|
5
5
|
import '../../shared/better-auth.7zTmTxT4.cjs';
|
|
6
6
|
import '../../shared/better-auth.DTtXpZYr.cjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
-
import { U as User, I as InferOptionSchema } from '../../shared/better-auth.
|
|
3
|
+
import { U as User, I as InferOptionSchema } from '../../shared/better-auth.B_xbPKKL.mjs';
|
|
4
4
|
import 'kysely';
|
|
5
5
|
import '../../shared/better-auth.BHPr8J54.mjs';
|
|
6
6
|
import '../../shared/better-auth.DTtXpZYr.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
-
import { U as User, I as InferOptionSchema } from '../../shared/better-auth.
|
|
3
|
+
import { U as User, I as InferOptionSchema } from '../../shared/better-auth.BQv0wGSb.js';
|
|
4
4
|
import 'kysely';
|
|
5
5
|
import '../../shared/better-auth.C6qXK08w.js';
|
|
6
6
|
import '../../shared/better-auth.DTtXpZYr.js';
|
|
@@ -3,7 +3,7 @@ import { a as createAuthEndpoint, g as getSessionFromCtx, B as BASE_ERROR_CODES
|
|
|
3
3
|
import { APIError } from 'better-call';
|
|
4
4
|
import { m as mergeSchema } from '../../shared/better-auth.Dlh8OCID.mjs';
|
|
5
5
|
import { g as generateRandomString } from '../../shared/better-auth.B4Qoxdgc.mjs';
|
|
6
|
-
import '../../shared/better-auth.
|
|
6
|
+
import '../../shared/better-auth.DsRTWTq9.mjs';
|
|
7
7
|
import { s as setSessionCookie } from '../../shared/better-auth.fV_ra52g.mjs';
|
|
8
8
|
import '../../shared/better-auth.CiuwFiHM.mjs';
|
|
9
9
|
import '../../shared/better-auth.C4g12FAA.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const betterCall = require('better-call');
|
|
4
|
-
require('../../shared/better-auth.
|
|
4
|
+
require('../../shared/better-auth.BDdoXh_7.cjs');
|
|
5
5
|
const session = require('../../shared/better-auth.CAcHGnwq.cjs');
|
|
6
6
|
const z = require('zod');
|
|
7
7
|
const cookies_index = require('../../shared/better-auth.CXM9s0dx.cjs');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
-
import { I as InferOptionSchema } from '../../shared/better-auth.
|
|
3
|
+
import { I as InferOptionSchema } from '../../shared/better-auth.CLmuULOM.cjs';
|
|
4
4
|
import 'kysely';
|
|
5
5
|
import '../../shared/better-auth.7zTmTxT4.cjs';
|
|
6
6
|
import '../../shared/better-auth.DTtXpZYr.cjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
-
import { I as InferOptionSchema } from '../../shared/better-auth.
|
|
3
|
+
import { I as InferOptionSchema } from '../../shared/better-auth.B_xbPKKL.mjs';
|
|
4
4
|
import 'kysely';
|
|
5
5
|
import '../../shared/better-auth.BHPr8J54.mjs';
|
|
6
6
|
import '../../shared/better-auth.DTtXpZYr.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
-
import { I as InferOptionSchema } from '../../shared/better-auth.
|
|
3
|
+
import { I as InferOptionSchema } from '../../shared/better-auth.BQv0wGSb.js';
|
|
4
4
|
import 'kysely';
|
|
5
5
|
import '../../shared/better-auth.C6qXK08w.js';
|
|
6
6
|
import '../../shared/better-auth.DTtXpZYr.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { APIError } from 'better-call';
|
|
2
|
-
import '../../shared/better-auth.
|
|
2
|
+
import '../../shared/better-auth.DsRTWTq9.mjs';
|
|
3
3
|
import { a as createAuthEndpoint } from '../../shared/better-auth.CBY7cUGy.mjs';
|
|
4
4
|
import * as z from 'zod';
|
|
5
5
|
import { s as setSessionCookie } from '../../shared/better-auth.fV_ra52g.mjs';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const z = require('zod');
|
|
4
4
|
const betterCall = require('better-call');
|
|
5
|
-
const socialProviders_index = require('../../shared/better-auth.
|
|
5
|
+
const socialProviders_index = require('../../shared/better-auth.BDdoXh_7.cjs');
|
|
6
6
|
const session = require('../../shared/better-auth.CAcHGnwq.cjs');
|
|
7
7
|
const cookies_index = require('../../shared/better-auth.CXM9s0dx.cjs');
|
|
8
8
|
require('../../shared/better-auth.CX8orviF.cjs');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
2
|
import * as z from 'zod';
|
|
3
3
|
import { O as OAuth2Tokens } from '../../shared/better-auth.7zTmTxT4.cjs';
|
|
4
|
-
import { U as User } from '../../shared/better-auth.
|
|
4
|
+
import { U as User } from '../../shared/better-auth.CLmuULOM.cjs';
|
|
5
5
|
import '../../shared/better-auth.DTtXpZYr.cjs';
|
|
6
6
|
import 'kysely';
|
|
7
7
|
import 'zod/v4/core';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
2
|
import * as z from 'zod';
|
|
3
3
|
import { O as OAuth2Tokens } from '../../shared/better-auth.BHPr8J54.mjs';
|
|
4
|
-
import { U as User } from '../../shared/better-auth.
|
|
4
|
+
import { U as User } from '../../shared/better-auth.B_xbPKKL.mjs';
|
|
5
5
|
import '../../shared/better-auth.DTtXpZYr.mjs';
|
|
6
6
|
import 'kysely';
|
|
7
7
|
import 'zod/v4/core';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
2
|
import * as z from 'zod';
|
|
3
3
|
import { O as OAuth2Tokens } from '../../shared/better-auth.C6qXK08w.js';
|
|
4
|
-
import { U as User } from '../../shared/better-auth.
|
|
4
|
+
import { U as User } from '../../shared/better-auth.BQv0wGSb.js';
|
|
5
5
|
import '../../shared/better-auth.DTtXpZYr.js';
|
|
6
6
|
import 'kysely';
|
|
7
7
|
import 'zod/v4/core';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
import { APIError } from 'better-call';
|
|
3
|
-
import { p as parseState, v as validateAuthorizationCode, b as validateToken, j as handleOAuthUserInfo, s as setTokenUtil, g as generateState, c as createAuthorizationURL } from '../../shared/better-auth.
|
|
3
|
+
import { p as parseState, v as validateAuthorizationCode, b as validateToken, j as handleOAuthUserInfo, s as setTokenUtil, g as generateState, c as createAuthorizationURL } from '../../shared/better-auth.DsRTWTq9.mjs';
|
|
4
4
|
import { a as createAuthEndpoint, s as sessionMiddleware } from '../../shared/better-auth.CBY7cUGy.mjs';
|
|
5
5
|
import { s as setSessionCookie } from '../../shared/better-auth.fV_ra52g.mjs';
|
|
6
6
|
import '../../shared/better-auth.Dlh8OCID.mjs';
|
|
@@ -4,7 +4,7 @@ const random = require('../../shared/better-auth.CYeOI8C-.cjs');
|
|
|
4
4
|
const z = require('zod');
|
|
5
5
|
const session = require('../../shared/better-auth.CAcHGnwq.cjs');
|
|
6
6
|
const betterCall = require('better-call');
|
|
7
|
-
require('../../shared/better-auth.
|
|
7
|
+
require('../../shared/better-auth.BDdoXh_7.cjs');
|
|
8
8
|
const cookies_index = require('../../shared/better-auth.CXM9s0dx.cjs');
|
|
9
9
|
const schema$1 = require('../../shared/better-auth.CX8orviF.cjs');
|
|
10
10
|
require('../../shared/better-auth.B6fIklBU.cjs');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
-
import { U as User, I as InferOptionSchema, z as AuthEndpoint, H as HookEndpointContext } from '../../shared/better-auth.
|
|
3
|
+
import { U as User, I as InferOptionSchema, z as AuthEndpoint, H as HookEndpointContext } from '../../shared/better-auth.CLmuULOM.cjs';
|
|
4
4
|
import { L as LiteralString } from '../../shared/better-auth.DTtXpZYr.cjs';
|
|
5
5
|
import * as _better_fetch_fetch from '@better-fetch/fetch';
|
|
6
6
|
import 'kysely';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
-
import { U as User, I as InferOptionSchema, z as AuthEndpoint, H as HookEndpointContext } from '../../shared/better-auth.
|
|
3
|
+
import { U as User, I as InferOptionSchema, z as AuthEndpoint, H as HookEndpointContext } from '../../shared/better-auth.B_xbPKKL.mjs';
|
|
4
4
|
import { L as LiteralString } from '../../shared/better-auth.DTtXpZYr.mjs';
|
|
5
5
|
import * as _better_fetch_fetch from '@better-fetch/fetch';
|
|
6
6
|
import 'kysely';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
2
|
import * as z from 'zod';
|
|
3
|
-
import { U as User, I as InferOptionSchema, z as AuthEndpoint, H as HookEndpointContext } from '../../shared/better-auth.
|
|
3
|
+
import { U as User, I as InferOptionSchema, z as AuthEndpoint, H as HookEndpointContext } from '../../shared/better-auth.BQv0wGSb.js';
|
|
4
4
|
import { L as LiteralString } from '../../shared/better-auth.DTtXpZYr.js';
|
|
5
5
|
import * as _better_fetch_fetch from '@better-fetch/fetch';
|
|
6
6
|
import 'kysely';
|
|
@@ -2,7 +2,7 @@ import { g as generateRandomString } from '../../shared/better-auth.B4Qoxdgc.mjs
|
|
|
2
2
|
import * as z from 'zod';
|
|
3
3
|
import { g as getSessionFromCtx, a as createAuthEndpoint, s as sessionMiddleware, B as BASE_ERROR_CODES, c as createAuthMiddleware } from '../../shared/better-auth.CBY7cUGy.mjs';
|
|
4
4
|
import { APIError } from 'better-call';
|
|
5
|
-
import '../../shared/better-auth.
|
|
5
|
+
import '../../shared/better-auth.DsRTWTq9.mjs';
|
|
6
6
|
import { s as setSessionCookie, d as deleteSessionCookie } from '../../shared/better-auth.fV_ra52g.mjs';
|
|
7
7
|
import { m as mergeSchema } from '../../shared/better-auth.Dlh8OCID.mjs';
|
|
8
8
|
import '../../shared/better-auth.CiuwFiHM.mjs';
|
|
@@ -4,8 +4,8 @@ const z = require('zod');
|
|
|
4
4
|
const session = require('../../shared/better-auth.CAcHGnwq.cjs');
|
|
5
5
|
const betterCall = require('better-call');
|
|
6
6
|
const cookies_index = require('../../shared/better-auth.CXM9s0dx.cjs');
|
|
7
|
-
const socialProviders_index = require('../../shared/better-auth.C0eUWmDH.cjs');
|
|
8
7
|
const schema = require('../../shared/better-auth.CX8orviF.cjs');
|
|
8
|
+
const socialProviders_index = require('../../shared/better-auth.BDdoXh_7.cjs');
|
|
9
9
|
require('../../shared/better-auth.B6fIklBU.cjs');
|
|
10
10
|
require('../../shared/better-auth.DTvRBuq4.cjs');
|
|
11
11
|
require('../../shared/better-auth.C1hdVENX.cjs');
|
|
@@ -252,8 +252,29 @@ const username = (options) => {
|
|
|
252
252
|
message: USERNAME_ERROR_CODES.INVALID_USERNAME_OR_PASSWORD
|
|
253
253
|
});
|
|
254
254
|
}
|
|
255
|
-
if (
|
|
256
|
-
|
|
255
|
+
if (ctx.context.options?.emailAndPassword?.requireEmailVerification && !user.emailVerified) {
|
|
256
|
+
if (!ctx.context.options?.emailVerification?.sendVerificationEmail) {
|
|
257
|
+
throw new betterCall.APIError("FORBIDDEN", {
|
|
258
|
+
message: USERNAME_ERROR_CODES.EMAIL_NOT_VERIFIED
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
if (ctx.context.options?.emailVerification?.sendOnSignIn) {
|
|
262
|
+
const token = await socialProviders_index.createEmailVerificationToken(
|
|
263
|
+
ctx.context.secret,
|
|
264
|
+
user.email,
|
|
265
|
+
void 0,
|
|
266
|
+
ctx.context.options.emailVerification?.expiresIn
|
|
267
|
+
);
|
|
268
|
+
const url = `${ctx.context.baseURL}/verify-email?token=${token}&callbackURL=${ctx.body.callbackURL || "/"}`;
|
|
269
|
+
await ctx.context.options.emailVerification.sendVerificationEmail(
|
|
270
|
+
{
|
|
271
|
+
user,
|
|
272
|
+
url,
|
|
273
|
+
token
|
|
274
|
+
},
|
|
275
|
+
ctx.request
|
|
276
|
+
);
|
|
277
|
+
}
|
|
257
278
|
throw new betterCall.APIError("FORBIDDEN", {
|
|
258
279
|
message: USERNAME_ERROR_CODES.EMAIL_NOT_VERIFIED
|
|
259
280
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
|
-
import { I as InferOptionSchema, d as AuthContext, G as GenericEndpointContext, H as HookEndpointContext } from '../../shared/better-auth.
|
|
2
|
+
import { I as InferOptionSchema, d as AuthContext, G as GenericEndpointContext, H as HookEndpointContext } from '../../shared/better-auth.CLmuULOM.cjs';
|
|
3
3
|
import * as z from 'zod';
|
|
4
4
|
import 'kysely';
|
|
5
5
|
import '../../shared/better-auth.7zTmTxT4.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
|
-
import { I as InferOptionSchema, d as AuthContext, G as GenericEndpointContext, H as HookEndpointContext } from '../../shared/better-auth.
|
|
2
|
+
import { I as InferOptionSchema, d as AuthContext, G as GenericEndpointContext, H as HookEndpointContext } from '../../shared/better-auth.B_xbPKKL.mjs';
|
|
3
3
|
import * as z from 'zod';
|
|
4
4
|
import 'kysely';
|
|
5
5
|
import '../../shared/better-auth.BHPr8J54.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as better_call from 'better-call';
|
|
2
|
-
import { I as InferOptionSchema, d as AuthContext, G as GenericEndpointContext, H as HookEndpointContext } from '../../shared/better-auth.
|
|
2
|
+
import { I as InferOptionSchema, d as AuthContext, G as GenericEndpointContext, H as HookEndpointContext } from '../../shared/better-auth.BQv0wGSb.js';
|
|
3
3
|
import * as z from 'zod';
|
|
4
4
|
import 'kysely';
|
|
5
5
|
import '../../shared/better-auth.C6qXK08w.js';
|
|
@@ -2,8 +2,8 @@ import * as z from 'zod';
|
|
|
2
2
|
import { c as createAuthMiddleware, a as createAuthEndpoint, B as BASE_ERROR_CODES } from '../../shared/better-auth.CBY7cUGy.mjs';
|
|
3
3
|
import { APIError } from 'better-call';
|
|
4
4
|
import { s as setSessionCookie } from '../../shared/better-auth.fV_ra52g.mjs';
|
|
5
|
-
import { T as sendVerificationEmailFn } from '../../shared/better-auth.C4cxDzG3.mjs';
|
|
6
5
|
import { m as mergeSchema } from '../../shared/better-auth.Dlh8OCID.mjs';
|
|
6
|
+
import { k as createEmailVerificationToken } from '../../shared/better-auth.DsRTWTq9.mjs';
|
|
7
7
|
import '../../shared/better-auth.CiuwFiHM.mjs';
|
|
8
8
|
import '../../shared/better-auth.C4g12FAA.mjs';
|
|
9
9
|
import '../../shared/better-auth.CW6D9eSx.mjs';
|
|
@@ -236,8 +236,29 @@ const username = (options) => {
|
|
|
236
236
|
message: USERNAME_ERROR_CODES.INVALID_USERNAME_OR_PASSWORD
|
|
237
237
|
});
|
|
238
238
|
}
|
|
239
|
-
if (
|
|
240
|
-
|
|
239
|
+
if (ctx.context.options?.emailAndPassword?.requireEmailVerification && !user.emailVerified) {
|
|
240
|
+
if (!ctx.context.options?.emailVerification?.sendVerificationEmail) {
|
|
241
|
+
throw new APIError("FORBIDDEN", {
|
|
242
|
+
message: USERNAME_ERROR_CODES.EMAIL_NOT_VERIFIED
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
if (ctx.context.options?.emailVerification?.sendOnSignIn) {
|
|
246
|
+
const token = await createEmailVerificationToken(
|
|
247
|
+
ctx.context.secret,
|
|
248
|
+
user.email,
|
|
249
|
+
void 0,
|
|
250
|
+
ctx.context.options.emailVerification?.expiresIn
|
|
251
|
+
);
|
|
252
|
+
const url = `${ctx.context.baseURL}/verify-email?token=${token}&callbackURL=${ctx.body.callbackURL || "/"}`;
|
|
253
|
+
await ctx.context.options.emailVerification.sendVerificationEmail(
|
|
254
|
+
{
|
|
255
|
+
user,
|
|
256
|
+
url,
|
|
257
|
+
token
|
|
258
|
+
},
|
|
259
|
+
ctx.request
|
|
260
|
+
);
|
|
261
|
+
}
|
|
241
262
|
throw new APIError("FORBIDDEN", {
|
|
242
263
|
message: USERNAME_ERROR_CODES.EMAIL_NOT_VERIFIED
|
|
243
264
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
2
|
import { SignJWT } from 'jose';
|
|
3
3
|
import { APIError } from 'better-call';
|
|
4
|
-
import './better-auth.
|
|
4
|
+
import './better-auth.DsRTWTq9.mjs';
|
|
5
5
|
import { g as getSessionFromCtx, a as createAuthEndpoint, c as createAuthMiddleware, s as sessionMiddleware } from './better-auth.CBY7cUGy.mjs';
|
|
6
6
|
import './better-auth.CiuwFiHM.mjs';
|
|
7
7
|
import { base64Url, base64 } from '@better-auth/utils/base64';
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
const z = require('zod');
|
|
4
4
|
const betterCall = require('better-call');
|
|
5
5
|
const session = require('./better-auth.CAcHGnwq.cjs');
|
|
6
|
-
require('./better-auth.
|
|
6
|
+
require('./better-auth.BDdoXh_7.cjs');
|
|
7
7
|
require('./better-auth.B6fIklBU.cjs');
|
|
8
8
|
const base64 = require('@better-auth/utils/base64');
|
|
9
9
|
require('@better-auth/utils/hmac');
|
|
10
10
|
require('./better-auth.DTvRBuq4.cjs');
|
|
11
11
|
require('@better-auth/utils/binary');
|
|
12
12
|
const schema = require('./better-auth.CX8orviF.cjs');
|
|
13
|
-
require('./better-auth.
|
|
13
|
+
require('./better-auth.CveVqL58.cjs');
|
|
14
14
|
require('../plugins/organization/access/index.cjs');
|
|
15
15
|
require('@better-auth/utils/random');
|
|
16
16
|
const hash = require('@better-auth/utils/hash');
|
|
@@ -36,7 +36,7 @@ function getSessionAtom($fetch) {
|
|
|
36
36
|
|
|
37
37
|
const getClientConfig = (options) => {
|
|
38
38
|
const isCredentialsSupported = "credentials" in Request.prototype;
|
|
39
|
-
const baseURL = getBaseURL(options?.baseURL, options?.basePath);
|
|
39
|
+
const baseURL = getBaseURL(options?.baseURL, options?.basePath) ?? "/api/auth";
|
|
40
40
|
const pluginsFetchPlugins = options?.plugins?.flatMap((plugin) => plugin.fetchPlugins).filter((pl) => pl !== void 0) || [];
|
|
41
41
|
const lifeCyclePlugin = {
|
|
42
42
|
id: "lifecycle-hooks",
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
const api_index = require('../api/index.cjs');
|
|
4
4
|
const defu = require('defu');
|
|
5
5
|
const crypto_index = require('../crypto/index.cjs');
|
|
6
|
-
const getMigration = require('./better-auth.
|
|
6
|
+
const getMigration = require('./better-auth.DIPz2ymP.cjs');
|
|
7
7
|
const getTables = require('./better-auth.DF_1VOmo.cjs');
|
|
8
8
|
const schema = require('./better-auth.CX8orviF.cjs');
|
|
9
9
|
require('zod');
|
|
10
10
|
const cookies_index = require('./better-auth.CXM9s0dx.cjs');
|
|
11
11
|
const logger = require('./better-auth.DTvRBuq4.cjs');
|
|
12
|
-
const socialProviders_index = require('./better-auth.
|
|
12
|
+
const socialProviders_index = require('./better-auth.BDdoXh_7.cjs');
|
|
13
13
|
const id = require('./better-auth.Bg6iw3ig.cjs');
|
|
14
14
|
require('better-call');
|
|
15
15
|
require('@better-auth/utils/hash');
|
|
@@ -6672,7 +6672,12 @@ function toAuthEndpoints(endpoints, ctx) {
|
|
|
6672
6672
|
}
|
|
6673
6673
|
internalContext = defuReplaceArrays(rest, internalContext);
|
|
6674
6674
|
} else if (before) {
|
|
6675
|
-
return before
|
|
6675
|
+
return context?.asResponse ? betterCall.toResponse(before, {
|
|
6676
|
+
headers: context?.headers
|
|
6677
|
+
}) : context?.returnHeaders ? {
|
|
6678
|
+
headers: context?.headers,
|
|
6679
|
+
response: before
|
|
6680
|
+
} : before;
|
|
6676
6681
|
}
|
|
6677
6682
|
internalContext.asResponse = false;
|
|
6678
6683
|
internalContext.returnHeaders = true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { G as GenericEndpointContext, I as InferOptionSchema, H as HookEndpointContext, d as AuthContext } from './better-auth.
|
|
1
|
+
import { G as GenericEndpointContext, I as InferOptionSchema, H as HookEndpointContext, d as AuthContext } from './better-auth.BQv0wGSb.js';
|
|
2
2
|
import { Statements } from '../plugins/access/index.js';
|
|
3
3
|
import * as zod_v4_core from 'zod/v4/core';
|
|
4
4
|
import * as z from 'zod';
|
|
@@ -355,8 +355,8 @@ declare const createFieldAttribute: <T extends FieldType, C extends Omit<FieldAt
|
|
|
355
355
|
};
|
|
356
356
|
returned?: boolean;
|
|
357
357
|
required?: boolean;
|
|
358
|
-
|
|
359
|
-
|
|
358
|
+
defaultValue?: Primitive | (() => Primitive);
|
|
359
|
+
onUpdate?: () => Primitive;
|
|
360
360
|
references?: {
|
|
361
361
|
/**
|
|
362
362
|
* The model to reference.
|
|
@@ -372,13 +372,13 @@ declare const createFieldAttribute: <T extends FieldType, C extends Omit<FieldAt
|
|
|
372
372
|
*/
|
|
373
373
|
onDelete?: "no action" | "restrict" | "cascade" | "set null" | "set default";
|
|
374
374
|
};
|
|
375
|
-
|
|
376
|
-
fieldName?: string;
|
|
377
|
-
onUpdate?: () => Primitive;
|
|
375
|
+
unique?: boolean;
|
|
378
376
|
validator?: {
|
|
379
377
|
input?: ZodType;
|
|
380
378
|
output?: ZodType;
|
|
381
379
|
};
|
|
380
|
+
fieldName?: string;
|
|
381
|
+
sortable?: boolean;
|
|
382
382
|
type: T;
|
|
383
383
|
};
|
|
384
384
|
type InferValueType<T extends FieldType> = T extends "string" ? string : T extends "number" ? number : T extends "boolean" ? boolean : T extends "date" ? Date : T extends `${infer T}[]` ? T extends "string" ? string[] : number[] : T extends Array<any> ? T[number] : never;
|
|
@@ -5588,7 +5588,7 @@ declare function getEndpoints<Option extends BetterAuthOptions>(ctx: Promise<Aut
|
|
|
5588
5588
|
user?: string | undefined;
|
|
5589
5589
|
} | undefined;
|
|
5590
5590
|
} & {
|
|
5591
|
-
method: "
|
|
5591
|
+
method: "POST" | "GET";
|
|
5592
5592
|
} & {
|
|
5593
5593
|
query?: {
|
|
5594
5594
|
code?: string | undefined;
|
|
@@ -5619,7 +5619,7 @@ declare function getEndpoints<Option extends BetterAuthOptions>(ctx: Promise<Aut
|
|
|
5619
5619
|
response: void;
|
|
5620
5620
|
} : void>;
|
|
5621
5621
|
options: {
|
|
5622
|
-
method: ("
|
|
5622
|
+
method: ("POST" | "GET")[];
|
|
5623
5623
|
body: z.ZodOptional<z.ZodObject<{
|
|
5624
5624
|
code: z.ZodOptional<z.ZodString>;
|
|
5625
5625
|
error: z.ZodOptional<z.ZodString>;
|
|
@@ -9280,7 +9280,7 @@ declare const router: <Option extends BetterAuthOptions>(ctx: AuthContext, optio
|
|
|
9280
9280
|
user?: string | undefined;
|
|
9281
9281
|
} | undefined;
|
|
9282
9282
|
} & {
|
|
9283
|
-
method: "
|
|
9283
|
+
method: "POST" | "GET";
|
|
9284
9284
|
} & {
|
|
9285
9285
|
query?: {
|
|
9286
9286
|
code?: string | undefined;
|
|
@@ -9311,7 +9311,7 @@ declare const router: <Option extends BetterAuthOptions>(ctx: AuthContext, optio
|
|
|
9311
9311
|
response: void;
|
|
9312
9312
|
} : void>;
|
|
9313
9313
|
options: {
|
|
9314
|
-
method: ("
|
|
9314
|
+
method: ("POST" | "GET")[];
|
|
9315
9315
|
body: z.ZodOptional<z.ZodObject<{
|
|
9316
9316
|
code: z.ZodOptional<z.ZodString>;
|
|
9317
9317
|
error: z.ZodOptional<z.ZodString>;
|
|
@@ -17408,17 +17408,21 @@ type FilterActions<API> = Omit<API, API extends {
|
|
|
17408
17408
|
type InferSessionAPI<API> = API extends {
|
|
17409
17409
|
[key: string]: infer E;
|
|
17410
17410
|
} ? UnionToIntersection<E extends Endpoint ? E["path"] extends "/get-session" ? {
|
|
17411
|
-
getSession: <R extends boolean>(context: {
|
|
17411
|
+
getSession: <R extends boolean, H extends boolean = false>(context: {
|
|
17412
17412
|
headers: Headers;
|
|
17413
17413
|
query?: {
|
|
17414
17414
|
disableCookieCache?: boolean;
|
|
17415
17415
|
disableRefresh?: boolean;
|
|
17416
17416
|
};
|
|
17417
17417
|
asResponse?: R;
|
|
17418
|
-
|
|
17418
|
+
returnHeaders?: H;
|
|
17419
|
+
}) => false extends R ? H extends true ? Promise<{
|
|
17420
|
+
headers: Headers;
|
|
17421
|
+
response: PrettifyDeep<Awaited<ReturnType<E>>>;
|
|
17422
|
+
}> : Promise<PrettifyDeep<Awaited<ReturnType<E>>> & {
|
|
17419
17423
|
options: E["options"];
|
|
17420
17424
|
path: E["path"];
|
|
17421
|
-
} : Promise<Response>;
|
|
17425
|
+
}> : Promise<Response>;
|
|
17422
17426
|
} : never : never> : never;
|
|
17423
17427
|
type InferAPI<API> = InferSessionAPI<API> & FilteredAPI<API>;
|
|
17424
17428
|
|