better-auth 1.3.13 → 1.3.15
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.cjs +1 -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/kysely-adapter/index.mjs +1 -1
- package/dist/adapters/memory-adapter/index.cjs +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/memory-adapter/index.mjs +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 +5 -5
- package/dist/client/index.cjs +3 -3
- 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 +3 -3
- package/dist/client/plugins/index.d.cts +3 -3
- package/dist/client/plugins/index.d.mts +3 -3
- package/dist/client/plugins/index.d.ts +3 -3
- package/dist/client/react/index.cjs +2 -2
- package/dist/client/react/index.d.cts +3 -3
- package/dist/client/react/index.d.mts +3 -3
- package/dist/client/react/index.d.ts +3 -3
- package/dist/client/react/index.mjs +2 -2
- package/dist/client/solid/index.cjs +2 -2
- package/dist/client/solid/index.d.cts +9 -9
- package/dist/client/solid/index.d.mts +9 -9
- package/dist/client/solid/index.d.ts +9 -9
- package/dist/client/solid/index.mjs +2 -2
- package/dist/client/svelte/index.cjs +2 -2
- package/dist/client/svelte/index.d.cts +3 -3
- package/dist/client/svelte/index.d.mts +3 -3
- package/dist/client/svelte/index.d.ts +3 -3
- package/dist/client/svelte/index.mjs +2 -2
- package/dist/client/vue/index.cjs +2 -2
- package/dist/client/vue/index.d.cts +3 -3
- package/dist/client/vue/index.d.mts +3 -3
- package/dist/client/vue/index.d.ts +3 -3
- package/dist/client/vue/index.mjs +2 -2
- package/dist/cookies/index.cjs +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/cookies/index.mjs +1 -1
- package/dist/db/index.cjs +3 -3
- 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 +3 -3
- package/dist/index.cjs +7 -7
- 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 +7 -7
- package/dist/integrations/next-js.cjs +4 -4
- 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 +4 -4
- 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 +4 -4
- 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 +4 -4
- package/dist/integrations/svelte-kit.cjs +3 -3
- 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 +3 -3
- package/dist/oauth2/index.cjs +3 -3
- 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 +3 -3
- package/dist/plugins/admin/index.cjs +4 -4
- package/dist/plugins/admin/index.d.cts +16 -1
- package/dist/plugins/admin/index.d.mts +16 -1
- package/dist/plugins/admin/index.d.ts +16 -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/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 +7 -9
- 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 +7 -9
- package/dist/plugins/device-authorization/index.cjs +18 -50
- 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/device-authorization/index.mjs +18 -50
- package/dist/plugins/email-otp/index.cjs +20 -60
- 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 +20 -60
- package/dist/plugins/generic-oauth/index.cjs +24 -42
- 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 +24 -42
- package/dist/plugins/haveibeenpwned/index.cjs +3 -3
- 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 +3 -3
- package/dist/plugins/index.cjs +10 -9
- 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 +12 -11
- package/dist/plugins/jwt/index.cjs +3 -3
- 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 +3 -3
- package/dist/plugins/magic-link/index.cjs +20 -30
- package/dist/plugins/magic-link/index.mjs +20 -30
- package/dist/plugins/multi-session/index.cjs +5 -9
- 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 +5 -9
- package/dist/plugins/oauth-proxy/index.cjs +8 -10
- package/dist/plugins/oauth-proxy/index.d.cts +2 -1
- package/dist/plugins/oauth-proxy/index.d.mts +2 -1
- package/dist/plugins/oauth-proxy/index.d.ts +2 -1
- package/dist/plugins/oauth-proxy/index.mjs +8 -10
- package/dist/plugins/oidc-provider/index.cjs +4 -4
- package/dist/plugins/oidc-provider/index.d.cts +9 -9
- package/dist/plugins/oidc-provider/index.d.mts +9 -9
- package/dist/plugins/oidc-provider/index.d.ts +9 -9
- package/dist/plugins/oidc-provider/index.mjs +4 -4
- package/dist/plugins/one-tap/index.cjs +6 -6
- package/dist/plugins/one-tap/index.mjs +6 -6
- package/dist/plugins/one-time-token/index.cjs +6 -6
- 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 +6 -6
- 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/access/index.d.cts +25 -25
- package/dist/plugins/organization/access/index.d.mts +25 -25
- package/dist/plugins/organization/access/index.d.ts +25 -25
- package/dist/plugins/organization/index.cjs +6 -6
- package/dist/plugins/organization/index.d.cts +77 -13
- package/dist/plugins/organization/index.d.mts +77 -13
- package/dist/plugins/organization/index.d.ts +77 -13
- package/dist/plugins/organization/index.mjs +6 -6
- package/dist/plugins/passkey/index.cjs +14 -18
- 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 +14 -18
- package/dist/plugins/phone-number/index.cjs +23 -39
- 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 +23 -39
- package/dist/plugins/siwe/index.cjs +3 -3
- 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 +3 -3
- package/dist/plugins/sso/index.cjs +61 -87
- package/dist/plugins/sso/index.d.cts +3 -3
- package/dist/plugins/sso/index.d.mts +3 -3
- package/dist/plugins/sso/index.d.ts +3 -3
- package/dist/plugins/sso/index.mjs +61 -87
- package/dist/plugins/two-factor/index.cjs +18 -48
- 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 +18 -48
- package/dist/plugins/username/index.cjs +31 -16
- package/dist/plugins/username/index.d.cts +3 -3
- package/dist/plugins/username/index.d.mts +3 -3
- package/dist/plugins/username/index.d.ts +3 -3
- package/dist/plugins/username/index.mjs +31 -16
- package/dist/shared/{better-auth.DNMTw_ds.d.ts → better-auth.6RZwqXI-.d.ts} +1 -1
- package/dist/shared/{better-auth.Btbv22jM.mjs → better-auth.7DsuGNVf.mjs} +5 -3
- package/dist/shared/{better-auth.C1AWk7z7.mjs → better-auth.AYS43XM1.mjs} +1 -1
- package/dist/shared/{better-auth.g33XFa_C.mjs → better-auth.B-3-wkBV.mjs} +167 -262
- package/dist/shared/{better-auth.BkcRiga0.cjs → better-auth.B-RhOtHf.cjs} +1 -1
- package/dist/shared/{better-auth.DTgTiHPJ.d.ts → better-auth.B1CNK_q_.d.ts} +1 -1
- package/dist/shared/{better-auth.BnOSz3eR.mjs → better-auth.BBFsjzvB.mjs} +2 -2
- package/dist/shared/{better-auth.Bhva6lEh.cjs → better-auth.BBk8MRta.cjs} +1 -1
- package/dist/shared/{better-auth.BYskLPvJ.d.ts → better-auth.BCHg51sY.d.ts} +1 -1
- package/dist/shared/{better-auth.C1Tqa_El.d.cts → better-auth.BTUgO__s.d.mts} +1 -1
- package/dist/shared/{better-auth.B5O-5tFi.cjs → better-auth.BclXpYOz.cjs} +5 -3
- package/dist/shared/{better-auth.DHi8l3iG.d.mts → better-auth.BeDYIF5-.d.mts} +1 -1
- package/dist/shared/{better-auth.yovXNUaS.d.cts → better-auth.BeOpqAwl.d.cts} +1 -1
- package/dist/shared/{better-auth.Brg-UO7k.d.ts → better-auth.BsnsCAjn.d.ts} +7 -7
- package/dist/shared/{better-auth.fV_ra52g.mjs → better-auth.C3bLnul-.mjs} +1 -1
- package/dist/shared/{better-auth.D6pGomIg.cjs → better-auth.C5s1d_o-.cjs} +75 -150
- package/dist/shared/{better-auth.C29_dxUJ.cjs → better-auth.CL5zQvRZ.cjs} +167 -262
- package/dist/shared/{better-auth.C0-0BnjK.d.mts → better-auth.CkCyjQ6r.d.mts} +1 -1
- package/dist/shared/{better-auth.CBY7cUGy.mjs → better-auth.Co88PbP3.mjs} +6 -10
- package/dist/shared/{better-auth.BPua9lvR.mjs → better-auth.D-4EtUes.mjs} +75 -150
- package/dist/shared/{better-auth.DXGtScCP.cjs → better-auth.D2444EHu.cjs} +2 -2
- package/dist/shared/{better-auth.DTyvXiMc.cjs → better-auth.DCOXb_2e.cjs} +48 -84
- package/dist/shared/{better-auth.DRukcsOo.d.mts → better-auth.DDOCnCqi.d.cts} +1 -1
- package/dist/shared/{better-auth.B1ufdjSo.mjs → better-auth.DFfA4Mzz.mjs} +5 -5
- package/dist/shared/{better-auth.CXM9s0dx.cjs → better-auth.DIfV2UBl.cjs} +1 -1
- package/dist/shared/{better-auth.spSlDaxD.cjs → better-auth.DP5SyJ_2.cjs} +68 -117
- package/dist/shared/{better-auth.DhsGZ30Q.cjs → better-auth.DUNU0obG.cjs} +1 -1
- package/dist/shared/{better-auth.Ddv1-cj-.mjs → better-auth.DUTxy-hg.mjs} +2 -2
- package/dist/shared/{better-auth.D07k8aB_.d.cts → better-auth.DY9WffSn.d.cts} +1 -1
- package/dist/shared/{better-auth.Bo_XNm3Z.mjs → better-auth.Df_5rmaV.mjs} +24 -48
- package/dist/shared/{better-auth.DL8idXrv.mjs → better-auth.DhQzyejE.mjs} +1 -1
- package/dist/shared/{better-auth.Gu1qAjVj.d.mts → better-auth.DhRmxPro.d.mts} +7 -7
- package/dist/shared/{better-auth.Bb_sp3q4.cjs → better-auth.DnBI2Nus.cjs} +5 -5
- package/dist/shared/{better-auth.Dsq5BCiY.mjs → better-auth.DteMRrRX.mjs} +68 -117
- package/dist/shared/{better-auth.demy6Fla.cjs → better-auth.DxN8-4Pz.cjs} +24 -48
- package/dist/shared/{better-auth.2jEckJ7k.cjs → better-auth.SS_wBML-.cjs} +2 -2
- package/dist/shared/{better-auth.3naUdTMW.mjs → better-auth.T3Ux10v9.mjs} +1 -1
- package/dist/shared/{better-auth.B1kKIM0o.d.cts → better-auth.U9CXSJA_.d.cts} +7 -7
- package/dist/shared/{better-auth.CvVm_hFg.cjs → better-auth.iE8wqp5_.cjs} +1 -1
- package/dist/shared/{better-auth.ffWeg50w.mjs → better-auth.msGOU0m9.mjs} +1 -1
- package/dist/shared/{better-auth.Cj28z0kQ.mjs → better-auth.vd9ibIsl.mjs} +48 -84
- package/dist/shared/{better-auth.CAcHGnwq.cjs → better-auth.wBgaxGEw.cjs} +6 -10
- package/dist/social-providers/index.cjs +3 -3
- package/dist/social-providers/index.mjs +3 -3
- package/dist/test-utils/index.cjs +11 -11
- package/dist/test-utils/index.d.cts +12 -12
- package/dist/test-utils/index.d.mts +12 -12
- package/dist/test-utils/index.d.ts +12 -12
- package/dist/test-utils/index.mjs +11 -11
- 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 +2 -6
|
@@ -4,7 +4,7 @@ const fetch$1 = require('@better-fetch/fetch');
|
|
|
4
4
|
const url = require('./better-auth.DRmln2Nr.cjs');
|
|
5
5
|
const nanostores = require('nanostores');
|
|
6
6
|
const query = require('./better-auth.D9AYOecd.cjs');
|
|
7
|
-
const parser = require('./better-auth.
|
|
7
|
+
const parser = require('./better-auth.DUNU0obG.cjs');
|
|
8
8
|
|
|
9
9
|
const redirectPlugin = {
|
|
10
10
|
id: "redirect",
|
|
@@ -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.BsnsCAjn.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';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as createAuthMiddleware, s as sessionMiddleware } from './better-auth.
|
|
1
|
+
import { c as createAuthMiddleware, s as sessionMiddleware } from './better-auth.Co88PbP3.mjs';
|
|
2
2
|
import 'better-call';
|
|
3
|
-
import './better-auth.
|
|
3
|
+
import './better-auth.D-4EtUes.mjs';
|
|
4
4
|
import * as z from 'zod';
|
|
5
5
|
import './better-auth.CiuwFiHM.mjs';
|
|
6
6
|
import '@better-auth/utils/base64';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as BetterAuthPlugin, B as BetterAuthOptions, ah as InferFieldsInputClient, af as InferFieldsOutput, U as User, S as Session, c as Auth } from './better-auth.
|
|
1
|
+
import { n as BetterAuthPlugin, B as BetterAuthOptions, ah as InferFieldsInputClient, af as InferFieldsOutput, U as User, S as Session, c as Auth } from './better-auth.BsnsCAjn.js';
|
|
2
2
|
import { BetterFetchOption, BetterFetchResponse, BetterFetch, BetterFetchPlugin } from '@better-fetch/fetch';
|
|
3
3
|
import { WritableAtom, Atom } from 'nanostores';
|
|
4
4
|
import { U as UnionToIntersection, H as HasRequiredKeys, a as Prettify, L as LiteralString, S as StripEmptyObjects } from './better-auth.DTtXpZYr.js';
|
|
@@ -21,8 +21,8 @@ require('./better-auth.B6fIklBU.cjs');
|
|
|
21
21
|
require('@better-auth/utils/random');
|
|
22
22
|
const index = require('./better-auth.ANpbi45u.cjs');
|
|
23
23
|
const getTables = require('./better-auth.DF_1VOmo.cjs');
|
|
24
|
-
const kyselyAdapter = require('./better-auth.
|
|
25
|
-
const memoryAdapter = require('./better-auth.
|
|
24
|
+
const kyselyAdapter = require('./better-auth.D2444EHu.cjs');
|
|
25
|
+
const memoryAdapter = require('./better-auth.BBk8MRta.cjs');
|
|
26
26
|
const kysely = require('kysely');
|
|
27
27
|
|
|
28
28
|
function getWithHooks(adapter, ctx) {
|
|
@@ -140,7 +140,9 @@ const createInternalAdapter = (adapter, ctx) => {
|
|
|
140
140
|
const parsed = json.safeJSONParse(cached);
|
|
141
141
|
if (!parsed) return;
|
|
142
142
|
const sessionTTL = Math.max(
|
|
143
|
-
Math.floor(
|
|
143
|
+
Math.floor(
|
|
144
|
+
(new Date(parsed.session.expiresAt).getTime() - now) / 1e3
|
|
145
|
+
),
|
|
144
146
|
0
|
|
145
147
|
);
|
|
146
148
|
await secondaryStorage.set(
|
|
@@ -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.DhRmxPro.mjs';
|
|
2
2
|
import { Statements } from '../plugins/access/index.mjs';
|
|
3
3
|
import * as zod_v4_core from 'zod/v4/core';
|
|
4
4
|
import * as z from 'zod';
|
|
@@ -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.U9CXSJA_.cjs';
|
|
2
2
|
import { Statements } from '../plugins/access/index.cjs';
|
|
3
3
|
import * as zod_v4_core from 'zod/v4/core';
|
|
4
4
|
import * as z from 'zod';
|
|
@@ -2240,11 +2240,11 @@ type InferSessionAPI<API> = API extends {
|
|
|
2240
2240
|
returnHeaders?: H;
|
|
2241
2241
|
}) => false extends R ? H extends true ? Promise<{
|
|
2242
2242
|
headers: Headers;
|
|
2243
|
-
response: PrettifyDeep<Awaited<ReturnType<E
|
|
2244
|
-
}> : Promise<PrettifyDeep<Awaited<ReturnType<E>>> & {
|
|
2243
|
+
response: PrettifyDeep<Awaited<ReturnType<E>>> | null;
|
|
2244
|
+
}> : Promise<(PrettifyDeep<Awaited<ReturnType<E>>> & {
|
|
2245
2245
|
options: E["options"];
|
|
2246
2246
|
path: E["path"];
|
|
2247
|
-
}> : Promise<Response>;
|
|
2247
|
+
}) | null> : Promise<Response>;
|
|
2248
2248
|
} : never : never> : never;
|
|
2249
2249
|
type InferAPI<API> = InferSessionAPI<API> & FilteredAPI<API>;
|
|
2250
2250
|
|
|
@@ -2558,7 +2558,7 @@ declare const signInSocial: {
|
|
|
2558
2558
|
callbackURL: z.ZodOptional<z.ZodString>;
|
|
2559
2559
|
newUserCallbackURL: z.ZodOptional<z.ZodString>;
|
|
2560
2560
|
errorCallbackURL: z.ZodOptional<z.ZodString>;
|
|
2561
|
-
provider: z.ZodType<"apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal"
|
|
2561
|
+
provider: z.ZodType<"apple" | (string & {}) | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal", unknown, z.core.$ZodTypeInternals<"apple" | (string & {}) | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal", unknown>>;
|
|
2562
2562
|
disableRedirect: z.ZodOptional<z.ZodBoolean>;
|
|
2563
2563
|
idToken: z.ZodOptional<z.ZodObject<{
|
|
2564
2564
|
token: z.ZodString;
|
|
@@ -5854,7 +5854,7 @@ declare const linkSocialAccount: {
|
|
|
5854
5854
|
requireHeaders: true;
|
|
5855
5855
|
body: z.ZodObject<{
|
|
5856
5856
|
callbackURL: z.ZodOptional<z.ZodString>;
|
|
5857
|
-
provider: z.ZodType<"apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal"
|
|
5857
|
+
provider: z.ZodType<"apple" | (string & {}) | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal", unknown, z.core.$ZodTypeInternals<"apple" | (string & {}) | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal", unknown>>;
|
|
5858
5858
|
idToken: z.ZodOptional<z.ZodObject<{
|
|
5859
5859
|
token: z.ZodString;
|
|
5860
5860
|
nonce: z.ZodOptional<z.ZodString>;
|
|
@@ -13914,7 +13914,7 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O & Record<neve
|
|
|
13914
13914
|
callbackURL: z.ZodOptional<z.ZodString>;
|
|
13915
13915
|
newUserCallbackURL: z.ZodOptional<z.ZodString>;
|
|
13916
13916
|
errorCallbackURL: z.ZodOptional<z.ZodString>;
|
|
13917
|
-
provider: z.ZodType<"apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal"
|
|
13917
|
+
provider: z.ZodType<"apple" | (string & {}) | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal", unknown, zod_v4_core.$ZodTypeInternals<"apple" | (string & {}) | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal", unknown>>;
|
|
13918
13918
|
disableRedirect: z.ZodOptional<z.ZodBoolean>;
|
|
13919
13919
|
idToken: z.ZodOptional<z.ZodObject<{
|
|
13920
13920
|
token: z.ZodString;
|
|
@@ -16765,7 +16765,7 @@ declare const betterAuth: <O extends BetterAuthOptions>(options: O & Record<neve
|
|
|
16765
16765
|
requireHeaders: true;
|
|
16766
16766
|
body: z.ZodObject<{
|
|
16767
16767
|
callbackURL: z.ZodOptional<z.ZodString>;
|
|
16768
|
-
provider: z.ZodType<"apple" | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal"
|
|
16768
|
+
provider: z.ZodType<"apple" | (string & {}) | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal", unknown, zod_v4_core.$ZodTypeInternals<"apple" | (string & {}) | "atlassian" | "cognito" | "discord" | "facebook" | "figma" | "github" | "microsoft" | "google" | "huggingface" | "slack" | "spotify" | "twitch" | "twitter" | "dropbox" | "kick" | "linear" | "linkedin" | "gitlab" | "tiktok" | "reddit" | "roblox" | "salesforce" | "vk" | "zoom" | "notion" | "kakao" | "naver" | "line" | "paypal", unknown>>;
|
|
16769
16769
|
idToken: z.ZodOptional<z.ZodObject<{
|
|
16770
16770
|
token: z.ZodString;
|
|
16771
16771
|
nonce: z.ZodOptional<z.ZodString>;
|
|
@@ -105,7 +105,7 @@ function parseSetCookieHeader(setCookie) {
|
|
|
105
105
|
cookieArray.forEach((cookieString) => {
|
|
106
106
|
const parts = cookieString.split(";").map((part) => part.trim());
|
|
107
107
|
const [nameValue, ...attributes] = parts;
|
|
108
|
-
const [name, ...valueParts] = nameValue.split("=");
|
|
108
|
+
const [name, ...valueParts] = (nameValue || "").split("=");
|
|
109
109
|
const value = valueParts.join("=");
|
|
110
110
|
if (!name || value === void 0) {
|
|
111
111
|
return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const z = require('zod');
|
|
4
|
-
const session = require('./better-auth.
|
|
4
|
+
const session = require('./better-auth.wBgaxGEw.cjs');
|
|
5
5
|
const betterCall = require('better-call');
|
|
6
6
|
const date = require('./better-auth.C1hdVENX.cjs');
|
|
7
7
|
const hash = require('@better-auth/utils/hash');
|
|
@@ -16,7 +16,7 @@ require('@better-auth/utils/hex');
|
|
|
16
16
|
require('@noble/hashes/utils.js');
|
|
17
17
|
const random = require('./better-auth.CYeOI8C-.cjs');
|
|
18
18
|
const url = require('./better-auth.DRmln2Nr.cjs');
|
|
19
|
-
const cookies_index = require('./better-auth.
|
|
19
|
+
const cookies_index = require('./better-auth.DIfV2UBl.cjs');
|
|
20
20
|
const errors = require('jose/errors');
|
|
21
21
|
require('@better-auth/utils/random');
|
|
22
22
|
const logger = require('./better-auth.DTvRBuq4.cjs');
|
|
@@ -302,12 +302,8 @@ const sendVerificationEmail = session.createAuthEndpoint(
|
|
|
302
302
|
{
|
|
303
303
|
method: "POST",
|
|
304
304
|
body: z__namespace.object({
|
|
305
|
-
email: z__namespace.email().
|
|
306
|
-
|
|
307
|
-
}),
|
|
308
|
-
callbackURL: z__namespace.string().meta({
|
|
309
|
-
description: "The URL to use for email verification callback"
|
|
310
|
-
}).optional()
|
|
305
|
+
email: z__namespace.email().describe("The email to send the verification email to"),
|
|
306
|
+
callbackURL: z__namespace.string().describe("The URL to use for email verification callback").optional()
|
|
311
307
|
}),
|
|
312
308
|
metadata: {
|
|
313
309
|
openapi: {
|
|
@@ -416,12 +412,8 @@ const verifyEmail = session.createAuthEndpoint(
|
|
|
416
412
|
{
|
|
417
413
|
method: "GET",
|
|
418
414
|
query: z__namespace.object({
|
|
419
|
-
token: z__namespace.string().
|
|
420
|
-
|
|
421
|
-
}),
|
|
422
|
-
callbackURL: z__namespace.string().meta({
|
|
423
|
-
description: "The URL to redirect to after email verification"
|
|
424
|
-
}).optional()
|
|
415
|
+
token: z__namespace.string().describe("The token to verify the email"),
|
|
416
|
+
callbackURL: z__namespace.string().describe("The URL to redirect to after email verification").optional()
|
|
425
417
|
}),
|
|
426
418
|
use: [originCheck((ctx) => ctx.query.callbackURL)],
|
|
427
419
|
metadata: {
|
|
@@ -3969,9 +3961,7 @@ const signInSocial = session.createAuthEndpoint(
|
|
|
3969
3961
|
* Callback URL to redirect to after the user
|
|
3970
3962
|
* has signed in.
|
|
3971
3963
|
*/
|
|
3972
|
-
callbackURL: z__namespace.string().
|
|
3973
|
-
description: "Callback URL to redirect to after the user has signed in"
|
|
3974
|
-
}).optional(),
|
|
3964
|
+
callbackURL: z__namespace.string().describe("Callback URL to redirect to after the user has signed in").optional(),
|
|
3975
3965
|
/**
|
|
3976
3966
|
* callback url to redirect if the user is newly registered.
|
|
3977
3967
|
*
|
|
@@ -3984,9 +3974,7 @@ const signInSocial = session.createAuthEndpoint(
|
|
|
3984
3974
|
* If it's initiated from the client sdk this defaults to
|
|
3985
3975
|
* the current url.
|
|
3986
3976
|
*/
|
|
3987
|
-
errorCallbackURL: z__namespace.string().
|
|
3988
|
-
description: "Callback URL to redirect to if an error happens"
|
|
3989
|
-
}).optional(),
|
|
3977
|
+
errorCallbackURL: z__namespace.string().describe("Callback URL to redirect to if an error happens").optional(),
|
|
3990
3978
|
/**
|
|
3991
3979
|
* OAuth2 provider to use`
|
|
3992
3980
|
*/
|
|
@@ -3997,9 +3985,9 @@ const signInSocial = session.createAuthEndpoint(
|
|
|
3997
3985
|
* This is useful if you want to handle the redirection
|
|
3998
3986
|
* yourself like in a popup or a different tab.
|
|
3999
3987
|
*/
|
|
4000
|
-
disableRedirect: z__namespace.boolean().
|
|
4001
|
-
|
|
4002
|
-
|
|
3988
|
+
disableRedirect: z__namespace.boolean().describe(
|
|
3989
|
+
"Disable automatic redirection to the provider. Useful for handling the redirection yourself"
|
|
3990
|
+
).optional(),
|
|
4003
3991
|
/**
|
|
4004
3992
|
* ID token from the provider
|
|
4005
3993
|
*
|
|
@@ -4016,38 +4004,28 @@ const signInSocial = session.createAuthEndpoint(
|
|
|
4016
4004
|
/**
|
|
4017
4005
|
* ID token from the provider
|
|
4018
4006
|
*/
|
|
4019
|
-
token: z__namespace.string().
|
|
4020
|
-
description: "ID token from the provider"
|
|
4021
|
-
}),
|
|
4007
|
+
token: z__namespace.string().describe("ID token from the provider"),
|
|
4022
4008
|
/**
|
|
4023
4009
|
* The nonce used to generate the token
|
|
4024
4010
|
*/
|
|
4025
|
-
nonce: z__namespace.string().
|
|
4026
|
-
description: "Nonce used to generate the token"
|
|
4027
|
-
}).optional(),
|
|
4011
|
+
nonce: z__namespace.string().describe("Nonce used to generate the token").optional(),
|
|
4028
4012
|
/**
|
|
4029
4013
|
* Access token from the provider
|
|
4030
4014
|
*/
|
|
4031
|
-
accessToken: z__namespace.string().
|
|
4032
|
-
description: "Access token from the provider"
|
|
4033
|
-
}).optional(),
|
|
4015
|
+
accessToken: z__namespace.string().describe("Access token from the provider").optional(),
|
|
4034
4016
|
/**
|
|
4035
4017
|
* Refresh token from the provider
|
|
4036
4018
|
*/
|
|
4037
|
-
refreshToken: z__namespace.string().
|
|
4038
|
-
description: "Refresh token from the provider"
|
|
4039
|
-
}).optional(),
|
|
4019
|
+
refreshToken: z__namespace.string().describe("Refresh token from the provider").optional(),
|
|
4040
4020
|
/**
|
|
4041
4021
|
* Expiry date of the token
|
|
4042
4022
|
*/
|
|
4043
|
-
expiresAt: z__namespace.number().
|
|
4044
|
-
description: "Expiry date of the token"
|
|
4045
|
-
}).optional()
|
|
4023
|
+
expiresAt: z__namespace.number().describe("Expiry date of the token").optional()
|
|
4046
4024
|
})
|
|
4047
4025
|
),
|
|
4048
|
-
scopes: z__namespace.array(z__namespace.string()).
|
|
4049
|
-
|
|
4050
|
-
|
|
4026
|
+
scopes: z__namespace.array(z__namespace.string()).describe(
|
|
4027
|
+
"Array of scopes to request from the provider. This will override the default scopes passed."
|
|
4028
|
+
).optional(),
|
|
4051
4029
|
/**
|
|
4052
4030
|
* Explicitly request sign-up
|
|
4053
4031
|
*
|
|
@@ -4055,15 +4033,13 @@ const signInSocial = session.createAuthEndpoint(
|
|
|
4055
4033
|
* disableImplicitSignUp for this provider is
|
|
4056
4034
|
* true
|
|
4057
4035
|
*/
|
|
4058
|
-
requestSignUp: z__namespace.boolean().
|
|
4059
|
-
|
|
4060
|
-
|
|
4036
|
+
requestSignUp: z__namespace.boolean().describe(
|
|
4037
|
+
"Explicitly request sign-up. Useful when disableImplicitSignUp is true for this provider"
|
|
4038
|
+
).optional(),
|
|
4061
4039
|
/**
|
|
4062
4040
|
* The login hint to use for the authorization code request
|
|
4063
4041
|
*/
|
|
4064
|
-
loginHint: z__namespace.string().
|
|
4065
|
-
description: "The login hint to use for the authorization code request"
|
|
4066
|
-
}).optional()
|
|
4042
|
+
loginHint: z__namespace.string().describe("The login hint to use for the authorization code request").optional()
|
|
4067
4043
|
}),
|
|
4068
4044
|
metadata: {
|
|
4069
4045
|
openapi: {
|
|
@@ -4252,29 +4228,23 @@ const signInEmail = session.createAuthEndpoint(
|
|
|
4252
4228
|
/**
|
|
4253
4229
|
* Email of the user
|
|
4254
4230
|
*/
|
|
4255
|
-
email: z__namespace.string().
|
|
4256
|
-
description: "Email of the user"
|
|
4257
|
-
}),
|
|
4231
|
+
email: z__namespace.string().describe("Email of the user"),
|
|
4258
4232
|
/**
|
|
4259
4233
|
* Password of the user
|
|
4260
4234
|
*/
|
|
4261
|
-
password: z__namespace.string().
|
|
4262
|
-
description: "Password of the user"
|
|
4263
|
-
}),
|
|
4235
|
+
password: z__namespace.string().describe("Password of the user"),
|
|
4264
4236
|
/**
|
|
4265
4237
|
* Callback URL to use as a redirect for email
|
|
4266
4238
|
* verification and for possible redirects
|
|
4267
4239
|
*/
|
|
4268
|
-
callbackURL: z__namespace.string().
|
|
4269
|
-
description: "Callback URL to use as a redirect for email verification"
|
|
4270
|
-
}).optional(),
|
|
4240
|
+
callbackURL: z__namespace.string().describe("Callback URL to use as a redirect for email verification").optional(),
|
|
4271
4241
|
/**
|
|
4272
4242
|
* If this is false, the session will not be remembered
|
|
4273
4243
|
* @default true
|
|
4274
4244
|
*/
|
|
4275
|
-
rememberMe: z__namespace.boolean().
|
|
4276
|
-
|
|
4277
|
-
|
|
4245
|
+
rememberMe: z__namespace.boolean().describe(
|
|
4246
|
+
"If this is false, the session will not be remembered. Default is `true`."
|
|
4247
|
+
).default(true).optional()
|
|
4278
4248
|
}),
|
|
4279
4249
|
metadata: {
|
|
4280
4250
|
openapi: {
|
|
@@ -4724,18 +4694,16 @@ const requestPasswordReset = session.createAuthEndpoint(
|
|
|
4724
4694
|
/**
|
|
4725
4695
|
* The email address of the user to send a password reset email to.
|
|
4726
4696
|
*/
|
|
4727
|
-
email: z__namespace.email().
|
|
4728
|
-
|
|
4729
|
-
|
|
4697
|
+
email: z__namespace.email().describe(
|
|
4698
|
+
"The email address of the user to send a password reset email to"
|
|
4699
|
+
),
|
|
4730
4700
|
/**
|
|
4731
4701
|
* The URL to redirect the user to reset their password.
|
|
4732
4702
|
* If the token isn't valid or expired, it'll be redirected with a query parameter `?
|
|
4733
4703
|
* error=INVALID_TOKEN`. If the token is valid, it'll be redirected with a query parameter `?
|
|
4734
4704
|
* token=VALID_TOKEN
|
|
4735
4705
|
*/
|
|
4736
|
-
redirectTo: z__namespace.string().
|
|
4737
|
-
description: "The URL to redirect the user to reset their password. If the token isn't valid or expired, it'll be redirected with a query parameter `?error=INVALID_TOKEN`. If the token is valid, it'll be redirected with a query parameter `?token=VALID_TOKEN"
|
|
4738
|
-
}).optional()
|
|
4706
|
+
redirectTo: z__namespace.string().describe("The URL to redirect the user to reset their password").optional()
|
|
4739
4707
|
}),
|
|
4740
4708
|
metadata: {
|
|
4741
4709
|
openapi: {
|
|
@@ -4820,18 +4788,16 @@ const forgetPassword = session.createAuthEndpoint(
|
|
|
4820
4788
|
/**
|
|
4821
4789
|
* The email address of the user to send a password reset email to.
|
|
4822
4790
|
*/
|
|
4823
|
-
email: z__namespace.string().email().
|
|
4824
|
-
|
|
4825
|
-
|
|
4791
|
+
email: z__namespace.string().email().describe(
|
|
4792
|
+
"The email address of the user to send a password reset email to"
|
|
4793
|
+
),
|
|
4826
4794
|
/**
|
|
4827
4795
|
* The URL to redirect the user to reset their password.
|
|
4828
4796
|
* If the token isn't valid or expired, it'll be redirected with a query parameter `?
|
|
4829
4797
|
* error=INVALID_TOKEN`. If the token is valid, it'll be redirected with a query parameter `?
|
|
4830
4798
|
* token=VALID_TOKEN
|
|
4831
4799
|
*/
|
|
4832
|
-
redirectTo: z__namespace.string().
|
|
4833
|
-
description: "The URL to redirect the user to reset their password. If the token isn't valid or expired, it'll be redirected with a query parameter `?error=INVALID_TOKEN`. If the token is valid, it'll be redirected with a query parameter `?token=VALID_TOKEN"
|
|
4834
|
-
}).optional()
|
|
4800
|
+
redirectTo: z__namespace.string().describe("The URL to redirect the user to reset their password").optional()
|
|
4835
4801
|
}),
|
|
4836
4802
|
metadata: {
|
|
4837
4803
|
openapi: {
|
|
@@ -4913,9 +4879,7 @@ const requestPasswordResetCallback = session.createAuthEndpoint(
|
|
|
4913
4879
|
{
|
|
4914
4880
|
method: "GET",
|
|
4915
4881
|
query: z__namespace.object({
|
|
4916
|
-
callbackURL: z__namespace.string().
|
|
4917
|
-
description: "The URL to redirect the user to reset their password"
|
|
4918
|
-
})
|
|
4882
|
+
callbackURL: z__namespace.string().describe("The URL to redirect the user to reset their password")
|
|
4919
4883
|
}),
|
|
4920
4884
|
use: [originCheck((ctx) => ctx.query.callbackURL)],
|
|
4921
4885
|
metadata: {
|
|
@@ -4969,12 +4933,8 @@ const resetPassword = session.createAuthEndpoint(
|
|
|
4969
4933
|
token: z__namespace.string().optional()
|
|
4970
4934
|
}).optional(),
|
|
4971
4935
|
body: z__namespace.object({
|
|
4972
|
-
newPassword: z__namespace.string().
|
|
4973
|
-
|
|
4974
|
-
}),
|
|
4975
|
-
token: z__namespace.string().meta({
|
|
4976
|
-
description: "The token to reset the password"
|
|
4977
|
-
}).optional()
|
|
4936
|
+
newPassword: z__namespace.string().describe("The new password to set"),
|
|
4937
|
+
token: z__namespace.string().describe("The token to reset the password").optional()
|
|
4978
4938
|
}),
|
|
4979
4939
|
metadata: {
|
|
4980
4940
|
openapi: {
|
|
@@ -5073,9 +5033,7 @@ const updateUser = () => session.createAuthEndpoint(
|
|
|
5073
5033
|
{
|
|
5074
5034
|
method: "POST",
|
|
5075
5035
|
body: z__namespace.record(
|
|
5076
|
-
z__namespace.string().
|
|
5077
|
-
description: "Field name must be a string"
|
|
5078
|
-
}),
|
|
5036
|
+
z__namespace.string().describe("Field name must be a string"),
|
|
5079
5037
|
z__namespace.any()
|
|
5080
5038
|
),
|
|
5081
5039
|
use: [session.sessionMiddleware],
|
|
@@ -5170,22 +5128,16 @@ const changePassword = session.createAuthEndpoint(
|
|
|
5170
5128
|
/**
|
|
5171
5129
|
* The new password to set
|
|
5172
5130
|
*/
|
|
5173
|
-
newPassword: z__namespace.string().
|
|
5174
|
-
description: "The new password to set"
|
|
5175
|
-
}),
|
|
5131
|
+
newPassword: z__namespace.string().describe("The new password to set"),
|
|
5176
5132
|
/**
|
|
5177
5133
|
* The current password of the user
|
|
5178
5134
|
*/
|
|
5179
|
-
currentPassword: z__namespace.string().
|
|
5180
|
-
description: "The current password is required"
|
|
5181
|
-
}),
|
|
5135
|
+
currentPassword: z__namespace.string().describe("The current password is required"),
|
|
5182
5136
|
/**
|
|
5183
5137
|
* revoke all sessions that are not the
|
|
5184
5138
|
* current one logged in by the user
|
|
5185
5139
|
*/
|
|
5186
|
-
revokeOtherSessions: z__namespace.boolean().
|
|
5187
|
-
description: "Must be a boolean value"
|
|
5188
|
-
}).optional()
|
|
5140
|
+
revokeOtherSessions: z__namespace.boolean().describe("Must be a boolean value").optional()
|
|
5189
5141
|
}),
|
|
5190
5142
|
use: [session.sensitiveSessionMiddleware],
|
|
5191
5143
|
metadata: {
|
|
@@ -5342,9 +5294,7 @@ const setPassword = session.createAuthEndpoint(
|
|
|
5342
5294
|
/**
|
|
5343
5295
|
* The new password to set
|
|
5344
5296
|
*/
|
|
5345
|
-
newPassword: z__namespace.string().
|
|
5346
|
-
description: "The new password to set is required"
|
|
5347
|
-
})
|
|
5297
|
+
newPassword: z__namespace.string().describe("The new password to set is required")
|
|
5348
5298
|
}),
|
|
5349
5299
|
metadata: {
|
|
5350
5300
|
SERVER_ONLY: true
|
|
@@ -5404,22 +5354,16 @@ const deleteUser = session.createAuthEndpoint(
|
|
|
5404
5354
|
* The callback URL to redirect to after the user is deleted
|
|
5405
5355
|
* this is only used on delete user callback
|
|
5406
5356
|
*/
|
|
5407
|
-
callbackURL: z__namespace.string().
|
|
5408
|
-
description: "The callback URL to redirect to after the user is deleted"
|
|
5409
|
-
}).optional(),
|
|
5357
|
+
callbackURL: z__namespace.string().describe("The callback URL to redirect to after the user is deleted").optional(),
|
|
5410
5358
|
/**
|
|
5411
5359
|
* The password of the user. If the password isn't provided, session freshness
|
|
5412
5360
|
* will be checked.
|
|
5413
5361
|
*/
|
|
5414
|
-
password: z__namespace.string().
|
|
5415
|
-
description: "The password of the user is required to delete the user"
|
|
5416
|
-
}).optional(),
|
|
5362
|
+
password: z__namespace.string().describe("The password of the user is required to delete the user").optional(),
|
|
5417
5363
|
/**
|
|
5418
5364
|
* The token to delete the user. If the token is provided, the user will be deleted
|
|
5419
5365
|
*/
|
|
5420
|
-
token: z__namespace.string().
|
|
5421
|
-
description: "The token to delete the user is required"
|
|
5422
|
-
}).optional()
|
|
5366
|
+
token: z__namespace.string().describe("The token to delete the user is required").optional()
|
|
5423
5367
|
}),
|
|
5424
5368
|
metadata: {
|
|
5425
5369
|
openapi: {
|
|
@@ -5555,12 +5499,8 @@ const deleteUserCallback = session.createAuthEndpoint(
|
|
|
5555
5499
|
{
|
|
5556
5500
|
method: "GET",
|
|
5557
5501
|
query: z__namespace.object({
|
|
5558
|
-
token: z__namespace.string().
|
|
5559
|
-
|
|
5560
|
-
}),
|
|
5561
|
-
callbackURL: z__namespace.string().meta({
|
|
5562
|
-
description: "The URL to redirect to after deletion"
|
|
5563
|
-
}).optional()
|
|
5502
|
+
token: z__namespace.string().describe("The token to verify the deletion request"),
|
|
5503
|
+
callbackURL: z__namespace.string().describe("The URL to redirect to after deletion").optional()
|
|
5564
5504
|
}),
|
|
5565
5505
|
use: [originCheck((ctx) => ctx.query.callbackURL)],
|
|
5566
5506
|
metadata: {
|
|
@@ -5646,12 +5586,8 @@ const changeEmail = session.createAuthEndpoint(
|
|
|
5646
5586
|
{
|
|
5647
5587
|
method: "POST",
|
|
5648
5588
|
body: z__namespace.object({
|
|
5649
|
-
newEmail: z__namespace.email().
|
|
5650
|
-
|
|
5651
|
-
}),
|
|
5652
|
-
callbackURL: z__namespace.string().meta({
|
|
5653
|
-
description: "The URL to redirect to after email verification"
|
|
5654
|
-
}).optional()
|
|
5589
|
+
newEmail: z__namespace.email().describe("The new email address to set must be a valid email address"),
|
|
5590
|
+
callbackURL: z__namespace.string().describe("The URL to redirect to after email verification").optional()
|
|
5655
5591
|
}),
|
|
5656
5592
|
use: [session.sensitiveSessionMiddleware],
|
|
5657
5593
|
metadata: {
|
|
@@ -6035,9 +5971,7 @@ const linkSocialAccount = session.createAuthEndpoint(
|
|
|
6035
5971
|
/**
|
|
6036
5972
|
* Callback URL to redirect to after the user has signed in.
|
|
6037
5973
|
*/
|
|
6038
|
-
callbackURL: z__namespace.string().
|
|
6039
|
-
description: "The URL to redirect to after the user has signed in"
|
|
6040
|
-
}).optional(),
|
|
5974
|
+
callbackURL: z__namespace.string().describe("The URL to redirect to after the user has signed in").optional(),
|
|
6041
5975
|
/**
|
|
6042
5976
|
* OAuth2 provider to use
|
|
6043
5977
|
*/
|
|
@@ -6061,24 +5995,22 @@ const linkSocialAccount = session.createAuthEndpoint(
|
|
|
6061
5995
|
* This is useful for requesting additional permissions when
|
|
6062
5996
|
* linking a social account compared to the initial authentication.
|
|
6063
5997
|
*/
|
|
6064
|
-
scopes: z__namespace.array(z__namespace.string()).
|
|
6065
|
-
description: "Additional scopes to request from the provider"
|
|
6066
|
-
}).optional(),
|
|
5998
|
+
scopes: z__namespace.array(z__namespace.string()).describe("Additional scopes to request from the provider").optional(),
|
|
6067
5999
|
/**
|
|
6068
6000
|
* The URL to redirect to if there is an error during the link process.
|
|
6069
6001
|
*/
|
|
6070
|
-
errorCallbackURL: z__namespace.string().
|
|
6071
|
-
|
|
6072
|
-
|
|
6002
|
+
errorCallbackURL: z__namespace.string().describe(
|
|
6003
|
+
"The URL to redirect to if there is an error during the link process"
|
|
6004
|
+
).optional(),
|
|
6073
6005
|
/**
|
|
6074
6006
|
* Disable automatic redirection to the provider
|
|
6075
6007
|
*
|
|
6076
6008
|
* This is useful if you want to handle the redirection
|
|
6077
6009
|
* yourself like in a popup or a different tab.
|
|
6078
6010
|
*/
|
|
6079
|
-
disableRedirect: z__namespace.boolean().
|
|
6080
|
-
|
|
6081
|
-
|
|
6011
|
+
disableRedirect: z__namespace.boolean().describe(
|
|
6012
|
+
"Disable automatic redirection to the provider. Useful for handling the redirection yourself"
|
|
6013
|
+
).optional()
|
|
6082
6014
|
}),
|
|
6083
6015
|
use: [session.sessionMiddleware],
|
|
6084
6016
|
metadata: {
|
|
@@ -6311,15 +6243,9 @@ const getAccessToken = session.createAuthEndpoint(
|
|
|
6311
6243
|
{
|
|
6312
6244
|
method: "POST",
|
|
6313
6245
|
body: z__namespace.object({
|
|
6314
|
-
providerId: z__namespace.string().
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
accountId: z__namespace.string().meta({
|
|
6318
|
-
description: "The account ID associated with the refresh token"
|
|
6319
|
-
}).optional(),
|
|
6320
|
-
userId: z__namespace.string().meta({
|
|
6321
|
-
description: "The user ID associated with the account"
|
|
6322
|
-
}).optional()
|
|
6246
|
+
providerId: z__namespace.string().describe("The provider ID for the OAuth provider"),
|
|
6247
|
+
accountId: z__namespace.string().describe("The account ID associated with the refresh token").optional(),
|
|
6248
|
+
userId: z__namespace.string().describe("The user ID associated with the account").optional()
|
|
6323
6249
|
}),
|
|
6324
6250
|
metadata: {
|
|
6325
6251
|
openapi: {
|
|
@@ -6436,15 +6362,9 @@ const refreshToken = session.createAuthEndpoint(
|
|
|
6436
6362
|
{
|
|
6437
6363
|
method: "POST",
|
|
6438
6364
|
body: z__namespace.object({
|
|
6439
|
-
providerId: z__namespace.string().
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
accountId: z__namespace.string().meta({
|
|
6443
|
-
description: "The account ID associated with the refresh token"
|
|
6444
|
-
}).optional(),
|
|
6445
|
-
userId: z__namespace.string().meta({
|
|
6446
|
-
description: "The user ID associated with the account"
|
|
6447
|
-
}).optional()
|
|
6365
|
+
providerId: z__namespace.string().describe("The provider ID for the OAuth provider"),
|
|
6366
|
+
accountId: z__namespace.string().describe("The account ID associated with the refresh token").optional(),
|
|
6367
|
+
userId: z__namespace.string().describe("The user ID associated with the account").optional()
|
|
6448
6368
|
}),
|
|
6449
6369
|
metadata: {
|
|
6450
6370
|
openapi: {
|
|
@@ -6596,9 +6516,9 @@ const accountInfo = session.createAuthEndpoint(
|
|
|
6596
6516
|
}
|
|
6597
6517
|
},
|
|
6598
6518
|
body: z__namespace.object({
|
|
6599
|
-
accountId: z__namespace.string().
|
|
6600
|
-
|
|
6601
|
-
|
|
6519
|
+
accountId: z__namespace.string().describe(
|
|
6520
|
+
"The provider given account id for which to get the account info"
|
|
6521
|
+
)
|
|
6602
6522
|
})
|
|
6603
6523
|
},
|
|
6604
6524
|
async (ctx) => {
|
|
@@ -6672,7 +6592,12 @@ function toAuthEndpoints(endpoints, ctx) {
|
|
|
6672
6592
|
}
|
|
6673
6593
|
internalContext = defuReplaceArrays(rest, internalContext);
|
|
6674
6594
|
} else if (before) {
|
|
6675
|
-
return before
|
|
6595
|
+
return context?.asResponse ? betterCall.toResponse(before, {
|
|
6596
|
+
headers: context?.headers
|
|
6597
|
+
}) : context?.returnHeaders ? {
|
|
6598
|
+
headers: context?.headers,
|
|
6599
|
+
response: before
|
|
6600
|
+
} : before;
|
|
6676
6601
|
}
|
|
6677
6602
|
internalContext.asResponse = false;
|
|
6678
6603
|
internalContext.returnHeaders = true;
|