@better-auth/infra 0.4.5 → 0.4.7
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/CHANGELOG.md +15 -2
- package/dist/client.d.mts +3 -16
- package/dist/client.mjs +24 -46
- package/dist/{constants-DjM7toCN.mjs → constants-BypXAAvQ.mjs} +1 -1
- package/dist/{crypto-BhIjjZNe.mjs → crypto-C9Iqqv8l.mjs} +1 -1
- package/dist/email.mjs +1 -1
- package/dist/{identify-client-options-Cim5Fztg.d.mts → identify-client-options-Be9mAljS.d.mts} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +11 -28
- package/dist/native.d.mts +1 -1
- package/dist/native.mjs +2 -2
- package/dist/{pow-retry-CsInOtOL.mjs → pow-retry-Bk5otjQT.mjs} +1 -1
- package/dist/{types-sP9ucYj1.d.mts → types-Ba7NK8JV.d.mts} +10 -16
- package/package.json +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,20 @@
|
|
|
3
3
|
All notable changes to `@better-auth/infra` are documented in this file.
|
|
4
4
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0/).
|
|
7
|
+
|
|
8
|
+
## [0.4.7] - 2026-09-07
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Sentinel types under `exactOptionalPropertyTypes`** — `sentinel()`, `sentinelClient()`, and `sentinelNativeClient()` type-check cleanly when consumers enable TypeScript `exactOptionalPropertyTypes`.
|
|
13
|
+
- **Sentinel audio fingerprint** — `sentinelClient()` now builds the audio component with `OfflineAudioContext` (and `webkitOfflineAudioContext`) instead of a live `AudioContext` + `ScriptProcessor`. Avoids autoplay/suspended-context and output-route failures in restricted browsers while keeping the same soft confidence signal on identify.
|
|
14
|
+
|
|
15
|
+
## [0.4.6] - 2026-09-07
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- **Better Auth 1.7.3 account identity** — Dropped never-shipped `account.identityStrategy` insights/compat. Issuer-scoped account paths (`issuer` column, `findAccountByKey`) remain only for better-auth 1.7.0–1.7.2; 1.7.3+ uses `(providerId, accountId)` again. Runtime still feature-detects issuer APIs when present.
|
|
7
20
|
|
|
8
21
|
## [0.4.5] - 2026-08-28
|
|
9
22
|
|
|
@@ -216,4 +229,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
216
229
|
[0.3.1]: https://github.com/better-auth/infrastructure/compare/infra@v0.3.0...infra@v0.3.1
|
|
217
230
|
[0.3.0]: https://github.com/better-auth/infrastructure/compare/infra@v0.2.14...infra@v0.3.0
|
|
218
231
|
[0.2.14]: https://github.com/better-auth/better-auth-infra/compare/@better-auth/infra@0.2.13...@better-auth/infra@0.2.14
|
|
219
|
-
[0.2.13]: https://github.com/better-auth/better-auth-infra/compare/@better-auth/infra@0.2.12...@better-auth/infra@0.2.13
|
|
232
|
+
[0.2.13]: https://github.com/better-auth/better-auth-infra/compare/@better-auth/infra@0.2.12...@better-auth/infra@0.2.13
|
package/dist/client.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { a as DashGetAllAuditLogsInput, i as DashClientOptions, n as DashAuditLog, o as DashGetAuditLogsInput, r as DashAuditLogsResponse, s as dashClient, t as IdentifyClientOptions } from "./identify-client-options-
|
|
1
|
+
import { a as DashGetAllAuditLogsInput, i as DashClientOptions, n as DashAuditLog, o as DashGetAuditLogsInput, r as DashAuditLogsResponse, s as dashClient, t as IdentifyClientOptions } from "./identify-client-options-Be9mAljS.mjs";
|
|
2
|
+
import { BetterFetchPlugin } from "@better-fetch/fetch";
|
|
2
3
|
//#region src/sentinel/client.d.ts
|
|
3
4
|
interface SentinelClientOptions {
|
|
4
5
|
/**
|
|
@@ -35,21 +36,7 @@ interface SentinelClientOptions {
|
|
|
35
36
|
}
|
|
36
37
|
declare const sentinelClient: (options?: SentinelClientOptions) => {
|
|
37
38
|
id: "sentinel";
|
|
38
|
-
fetchPlugins:
|
|
39
|
-
id: string;
|
|
40
|
-
name: string;
|
|
41
|
-
hooks: {
|
|
42
|
-
onRequest<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>): Promise<import("@better-fetch/fetch").RequestContext<T>>;
|
|
43
|
-
onResponse?: undefined;
|
|
44
|
-
};
|
|
45
|
-
} | {
|
|
46
|
-
id: string;
|
|
47
|
-
name: string;
|
|
48
|
-
hooks: {
|
|
49
|
-
onResponse(context: import("@better-fetch/fetch").ResponseContext): Promise<import("@better-fetch/fetch").ResponseContext>;
|
|
50
|
-
onRequest<T extends Record<string, any>>(context: import("@better-fetch/fetch").RequestContext<T>): Promise<import("@better-fetch/fetch").RequestContext<T>>;
|
|
51
|
-
};
|
|
52
|
-
})[];
|
|
39
|
+
fetchPlugins: BetterFetchPlugin[];
|
|
53
40
|
};
|
|
54
41
|
//#endregion
|
|
55
42
|
export { type DashAuditLog, type DashAuditLogsResponse, type DashClientOptions, type DashGetAllAuditLogsInput, type DashGetAuditLogsInput, type SentinelClientOptions, dashClient, sentinelClient };
|
package/dist/client.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as hash, o as createKV } from "./crypto-
|
|
2
|
-
import { a as resolveSentinelClientIdentifyUrl, c as identify, i as solvePoWChallenge, l as dashClient, n as decodePoWChallenge, o as resolveIdentifyClientRetry, r as encodePoWSolution, s as generateRequestId, t as createPowRetryTimeout } from "./pow-retry-
|
|
1
|
+
import { n as hash, o as createKV } from "./crypto-C9Iqqv8l.mjs";
|
|
2
|
+
import { a as resolveSentinelClientIdentifyUrl, c as identify, i as solvePoWChallenge, l as dashClient, n as decodePoWChallenge, o as resolveIdentifyClientRetry, r as encodePoWSolution, s as generateRequestId, t as createPowRetryTimeout } from "./pow-retry-Bk5otjQT.mjs";
|
|
3
3
|
import { env } from "@better-auth/core/env";
|
|
4
4
|
//#region src/sentinel/fingerprint.ts
|
|
5
5
|
function murmurhash3(str, seed = 0) {
|
|
@@ -123,54 +123,32 @@ function getWebGLFingerprint() {
|
|
|
123
123
|
}
|
|
124
124
|
async function getAudioFingerprint() {
|
|
125
125
|
try {
|
|
126
|
-
const
|
|
127
|
-
if (!
|
|
128
|
-
const context = new
|
|
126
|
+
const OfflineAudioContextClass = window.OfflineAudioContext || window.webkitOfflineAudioContext;
|
|
127
|
+
if (!OfflineAudioContextClass) return null;
|
|
128
|
+
const context = new OfflineAudioContextClass(1, 4096, 44100);
|
|
129
129
|
const oscillator = context.createOscillator();
|
|
130
|
-
const
|
|
131
|
-
const gain = context.createGain();
|
|
132
|
-
const scriptProcessor = context.createScriptProcessor(4096, 1, 1);
|
|
133
|
-
gain.gain.value = 0;
|
|
130
|
+
const compressor = context.createDynamicsCompressor();
|
|
134
131
|
oscillator.type = "triangle";
|
|
135
132
|
oscillator.frequency.setValueAtTime(1e4, context.currentTime);
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
133
|
+
compressor.threshold.setValueAtTime(-50, context.currentTime);
|
|
134
|
+
compressor.knee.setValueAtTime(40, context.currentTime);
|
|
135
|
+
compressor.ratio.setValueAtTime(12, context.currentTime);
|
|
136
|
+
compressor.attack.setValueAtTime(0, context.currentTime);
|
|
137
|
+
compressor.release.setValueAtTime(.25, context.currentTime);
|
|
138
|
+
oscillator.connect(compressor);
|
|
139
|
+
compressor.connect(context.destination);
|
|
140
140
|
oscillator.start(0);
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
try {
|
|
153
|
-
if (context.state !== "closed") context.close();
|
|
154
|
-
} catch {}
|
|
155
|
-
};
|
|
156
|
-
return new Promise((resolve) => {
|
|
157
|
-
scriptProcessor.onaudioprocess = (e) => {
|
|
158
|
-
if (resolved) return;
|
|
159
|
-
const output = e.inputBuffer.getChannelData(0);
|
|
160
|
-
let sum = 0;
|
|
161
|
-
for (let i = 0; i < output.length; i++) {
|
|
162
|
-
const val = output[i];
|
|
163
|
-
if (val !== void 0) sum += Math.abs(val);
|
|
164
|
-
}
|
|
165
|
-
cleanup();
|
|
166
|
-
resolve(sum);
|
|
167
|
-
};
|
|
168
|
-
setTimeout(() => {
|
|
169
|
-
if (resolved) return;
|
|
170
|
-
cleanup();
|
|
171
|
-
resolve(null);
|
|
172
|
-
}, 1e3);
|
|
173
|
-
});
|
|
141
|
+
const buffer = await Promise.race([context.startRendering(), new Promise((resolve) => {
|
|
142
|
+
setTimeout(() => resolve(null), 1e3);
|
|
143
|
+
})]);
|
|
144
|
+
if (!buffer) return null;
|
|
145
|
+
const output = buffer.getChannelData(0);
|
|
146
|
+
let sum = 0;
|
|
147
|
+
for (let i = 0; i < output.length; i++) {
|
|
148
|
+
const val = output[i];
|
|
149
|
+
if (val !== void 0) sum += Math.abs(val);
|
|
150
|
+
}
|
|
151
|
+
return sum;
|
|
174
152
|
} catch {
|
|
175
153
|
return null;
|
|
176
154
|
}
|
package/dist/email.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as INFRA_USER_AGENT, n as INFRA_API_URL } from "./constants-
|
|
1
|
+
import { i as INFRA_USER_AGENT, n as INFRA_API_URL } from "./constants-BypXAAvQ.mjs";
|
|
2
2
|
import { logger } from "better-auth";
|
|
3
3
|
import { env } from "@better-auth/core/env";
|
|
4
4
|
import { createFetch } from "@better-fetch/fetch";
|
package/dist/{identify-client-options-Cim5Fztg.d.mts → identify-client-options-Be9mAljS.d.mts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { m as KvRetryOptions } from "./types-
|
|
1
|
+
import { m as KvRetryOptions } from "./types-Ba7NK8JV.mjs";
|
|
2
2
|
import { BetterAuthClientOptions, ClientStore } from "better-auth";
|
|
3
3
|
import { BetterFetch } from "@better-fetch/fetch";
|
|
4
4
|
//#region src/dash-client.d.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as ImpossibleTravelResult, D as SecurityVerdict, E as SecurityOptions, O as StaleUserResult, S as CredentialStuffingResult, T as SecurityEventType, _ as LocationDataContext, a as DashOptionsInternal, b as sentinel, c as EndpointOptions, d as InfraPluginConnectionOptionsInternal, f as KvOptions, g as LocationData, h as KvRetryOptionsResolved, i as DashOptions, k as ThresholdConfig, l as InfraEndpointContext, m as KvRetryOptions, n as ApiOptions, o as DashOptionsResolved, p as KvOptionsResolved, r as ApiOptionsResolved, s as Endpoint, t as APIError, u as InfraPluginConnectionOptions, v as SentinelOptions, w as SecurityEvent, x as CompromisedPasswordResult, y as SentinelOptionsInternal } from "./types-
|
|
1
|
+
import { C as ImpossibleTravelResult, D as SecurityVerdict, E as SecurityOptions, O as StaleUserResult, S as CredentialStuffingResult, T as SecurityEventType, _ as LocationDataContext, a as DashOptionsInternal, b as sentinel, c as EndpointOptions, d as InfraPluginConnectionOptionsInternal, f as KvOptions, g as LocationData, h as KvRetryOptionsResolved, i as DashOptions, k as ThresholdConfig, l as InfraEndpointContext, m as KvRetryOptions, n as ApiOptions, o as DashOptionsResolved, p as KvOptionsResolved, r as ApiOptionsResolved, s as Endpoint, t as APIError, u as InfraPluginConnectionOptions, v as SentinelOptions, w as SecurityEvent, x as CompromisedPasswordResult, y as SentinelOptionsInternal } from "./types-Ba7NK8JV.mjs";
|
|
2
2
|
import { EMAIL_TEMPLATES, EmailConfig, EmailTemplateId, EmailTemplateVariables, SendBulkEmailsOptions, SendBulkEmailsResult, SendEmailOptions, SendEmailResult, createEmailSender, sendBulkEmails, sendEmail } from "./email.mjs";
|
|
3
3
|
import { Account, AuthContext, GenericEndpointContext, Session, User } from "better-auth";
|
|
4
4
|
import z from "zod";
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as INFRA_USER_AGENT, n as INFRA_API_URL, o as PLUGIN_VERSION, r as INFRA_KV_URL } from "./constants-
|
|
2
|
-
import { a as createAPI, n as hash$1, o as createKV, r as hmacSha256Hex } from "./crypto-
|
|
1
|
+
import { i as INFRA_USER_AGENT, n as INFRA_API_URL, o as PLUGIN_VERSION, r as INFRA_KV_URL } from "./constants-BypXAAvQ.mjs";
|
|
2
|
+
import { a as createAPI, n as hash$1, o as createKV, r as hmacSha256Hex } from "./crypto-C9Iqqv8l.mjs";
|
|
3
3
|
import { EMAIL_TEMPLATES, createEmailSender, sendBulkEmails, sendEmail } from "./email.mjs";
|
|
4
4
|
import { getCurrentAdapter, getCurrentAuthContext, getCurrentDBAdapterAsyncLocalStorage, runWithTransaction } from "@better-auth/core/context";
|
|
5
5
|
import { APIError, generateId, getAuthTables, logger } from "better-auth";
|
|
@@ -386,37 +386,23 @@ const getLoginMethod = (ctx) => {
|
|
|
386
386
|
//#endregion
|
|
387
387
|
//#region src/compat/account.ts
|
|
388
388
|
/**
|
|
389
|
-
* Mirrors better-auth 1.7
|
|
389
|
+
* Mirrors better-auth 1.7.0–1.7.2 `createLocalAccountIssuer` so infra can
|
|
390
390
|
* typecheck against older core packages while emitting the same issuer strings.
|
|
391
391
|
*/
|
|
392
392
|
function createLocalAccountIssuer(providerId) {
|
|
393
393
|
return `local:${encodeURIComponent(providerId)}`;
|
|
394
394
|
}
|
|
395
395
|
/**
|
|
396
|
-
* Mirrors better-auth 1.7
|
|
396
|
+
* Mirrors better-auth 1.7.0–1.7.2 `createOAuthAccountIssuer`.
|
|
397
397
|
*/
|
|
398
398
|
function createOAuthAccountIssuer(providerId) {
|
|
399
399
|
return `local:oauth:${encodeURIComponent(providerId)}`;
|
|
400
400
|
}
|
|
401
|
-
/** Configured strategy when set; `null` when omitted (pre-option or default). */
|
|
402
|
-
function getConfiguredAccountIdentityStrategy(account) {
|
|
403
|
-
const strategy = account?.identityStrategy;
|
|
404
|
-
if (strategy === "provider-id" || strategy === "issuer") return strategy;
|
|
405
|
-
return null;
|
|
406
|
-
}
|
|
407
|
-
/**
|
|
408
|
-
* Effective strategy for account-key derivation.
|
|
409
|
-
* Matches better-auth: omit/`"issuer"` → issuer-scoped; `"provider-id"` → provider-scoped.
|
|
410
|
-
*/
|
|
411
|
-
function resolveAccountIdentityStrategy(account) {
|
|
412
|
-
return getConfiguredAccountIdentityStrategy(account) ?? "issuer";
|
|
413
|
-
}
|
|
414
401
|
/**
|
|
415
|
-
* Resolves the OAuth account issuer the same way better-auth
|
|
416
|
-
*
|
|
402
|
+
* Resolves the OAuth account issuer the same way better-auth 1.7.0–1.7.2 did
|
|
403
|
+
* for issuer-scoped account keys.
|
|
417
404
|
*/
|
|
418
405
|
async function resolveOAuthAccountIssuer(params) {
|
|
419
|
-
if (params.identityStrategy === "provider-id") return createOAuthAccountIssuer(params.providerId);
|
|
420
406
|
const { accountIssuer } = params;
|
|
421
407
|
if (typeof accountIssuer === "function") {
|
|
422
408
|
const issuer = await accountIssuer(params.context);
|
|
@@ -459,7 +445,7 @@ function normalizeProviderSubject(subject) {
|
|
|
459
445
|
if (!subject || subject === "undefined" || subject === "null") return;
|
|
460
446
|
return subject;
|
|
461
447
|
}
|
|
462
|
-
async function resolveAccountKey(provider, tokens, profile
|
|
448
|
+
async function resolveAccountKey(provider, tokens, profile) {
|
|
463
449
|
const keyedProvider = provider;
|
|
464
450
|
const context = {
|
|
465
451
|
tokens,
|
|
@@ -477,7 +463,6 @@ async function resolveAccountKey(provider, tokens, profile, identityStrategy) {
|
|
|
477
463
|
if (!accountId) return void 0;
|
|
478
464
|
const issuer = await resolveOAuthAccountIssuer({
|
|
479
465
|
providerId: provider.id,
|
|
480
|
-
identityStrategy,
|
|
481
466
|
accountIssuer: keyedProvider.accountIssuer,
|
|
482
467
|
context
|
|
483
468
|
});
|
|
@@ -503,8 +488,7 @@ function instrumentSocialProviders(providers) {
|
|
|
503
488
|
if (user) try {
|
|
504
489
|
const endpointCtx = await getCurrentAuthContext();
|
|
505
490
|
const adapter = endpointCtx.context.internalAdapter;
|
|
506
|
-
const
|
|
507
|
-
const accountKey = result.data && typeof adapter.findAccountOwnerByKey === "function" ? await resolveAccountKey(provider, token, result.data, identityStrategy) : void 0;
|
|
491
|
+
const accountKey = result.data && typeof adapter.findAccountOwnerByKey === "function" ? await resolveAccountKey(provider, token, result.data) : void 0;
|
|
508
492
|
endpointCtx.context[OAUTH_CALLBACK_USER] = {
|
|
509
493
|
user,
|
|
510
494
|
accountKey
|
|
@@ -2592,8 +2576,8 @@ const sentinel = (options) => {
|
|
|
2592
2576
|
customRules
|
|
2593
2577
|
} },
|
|
2594
2578
|
options: {
|
|
2595
|
-
emailValidation: opts.security
|
|
2596
|
-
emailNormalization: opts.security
|
|
2579
|
+
...opts.security?.emailValidation !== void 0 ? { emailValidation: opts.security.emailValidation } : {},
|
|
2580
|
+
...opts.security?.emailNormalization !== void 0 ? { emailNormalization: opts.security.emailNormalization } : {},
|
|
2597
2581
|
rateLimit: { customRules },
|
|
2598
2582
|
databaseHooks: {
|
|
2599
2583
|
user: {
|
|
@@ -4300,7 +4284,7 @@ function isVersionAtLeast(version, target) {
|
|
|
4300
4284
|
}
|
|
4301
4285
|
/**
|
|
4302
4286
|
* True for better-auth 1.7+ (including 1.8+).
|
|
4303
|
-
* Marks the cutover for
|
|
4287
|
+
* Marks the cutover for protocol-defined SSO subjects,
|
|
4304
4288
|
* `advanced.database.joins`, and post-legacy SCIM connections.
|
|
4305
4289
|
* Keep in sync with `apps/web/lib/better-auth-compat.ts`.
|
|
4306
4290
|
*/
|
|
@@ -4430,7 +4414,6 @@ const getConfig = (options) => {
|
|
|
4430
4414
|
disableCSRFCheck: ctx.context.options.advanced?.disableCSRFCheck || false,
|
|
4431
4415
|
disableOriginCheck: ctx.context.options.advanced?.disableOriginCheck || false,
|
|
4432
4416
|
allowDifferentEmails: ctx.context.options.account?.accountLinking?.enabled && ctx.context.options.account?.accountLinking?.allowDifferentEmails || false,
|
|
4433
|
-
identityStrategy: getConfiguredAccountIdentityStrategy(ctx.context.options.account),
|
|
4434
4417
|
skipStateCookieCheck: ctx.context.options.account?.skipStateCookieCheck || false,
|
|
4435
4418
|
storeStateCookieStrategy: ctx.context.options.account?.storeStateStrategy || null,
|
|
4436
4419
|
cookieCache: {
|
package/dist/native.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as DashGetAllAuditLogsInput, i as DashClientOptions, n as DashAuditLog, o as DashGetAuditLogsInput, r as DashAuditLogsResponse, s as dashClient, t as IdentifyClientOptions } from "./identify-client-options-
|
|
1
|
+
import { a as DashGetAllAuditLogsInput, i as DashClientOptions, n as DashAuditLog, o as DashGetAuditLogsInput, r as DashAuditLogsResponse, s as dashClient, t as IdentifyClientOptions } from "./identify-client-options-Be9mAljS.mjs";
|
|
2
2
|
import { BetterAuthClientPlugin } from "better-auth";
|
|
3
3
|
//#region src/sentinel/native/client.d.ts
|
|
4
4
|
interface SentinelNativeClientOptions {
|
package/dist/native.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as createKV, t as bytesToHex } from "./crypto-
|
|
2
|
-
import { a as resolveSentinelClientIdentifyUrl, c as identify, i as solvePoWChallenge, l as dashClient, n as decodePoWChallenge, o as resolveIdentifyClientRetry, r as encodePoWSolution, t as createPowRetryTimeout } from "./pow-retry-
|
|
1
|
+
import { o as createKV, t as bytesToHex } from "./crypto-C9Iqqv8l.mjs";
|
|
2
|
+
import { a as resolveSentinelClientIdentifyUrl, c as identify, i as solvePoWChallenge, l as dashClient, n as decodePoWChallenge, o as resolveIdentifyClientRetry, r as encodePoWSolution, t as createPowRetryTimeout } from "./pow-retry-Bk5otjQT.mjs";
|
|
3
3
|
import { env } from "@better-auth/core/env";
|
|
4
4
|
import { Dimensions, InteractionManager, PixelRatio, Platform } from "react-native";
|
|
5
5
|
//#region src/sentinel/native/components.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as randomBytes, n as hash, t as bytesToHex } from "./crypto-
|
|
1
|
+
import { i as randomBytes, n as hash, t as bytesToHex } from "./crypto-C9Iqqv8l.mjs";
|
|
2
2
|
//#region src/dash-client.ts
|
|
3
3
|
function resolveDashUserId(input, options) {
|
|
4
4
|
return input.userId || options?.resolveUserId?.({
|
|
@@ -170,28 +170,13 @@ declare const sentinel: (options?: SentinelOptions) => {
|
|
|
170
170
|
init(ctx: import("better-auth").AuthContext): {
|
|
171
171
|
context: {
|
|
172
172
|
rateLimit: {
|
|
173
|
-
customRules: {
|
|
174
|
-
[key: string]: false | BetterAuthRateLimitRule | ((request: Request, currentRule: BetterAuthRateLimitRule) => import("@better-auth/core").Awaitable<false | BetterAuthRateLimitRule>);
|
|
175
|
-
};
|
|
176
173
|
enabled: boolean;
|
|
177
174
|
window: number;
|
|
178
175
|
max: number;
|
|
179
176
|
storage: "memory" | "database" | "secondary-storage";
|
|
180
|
-
|
|
181
|
-
fields?: Partial<Record<"key" | "count" | "lastRequest", string>> | undefined;
|
|
182
|
-
customStorage?: import("better-auth").BetterAuthRateLimitStorage | undefined;
|
|
183
|
-
};
|
|
177
|
+
} & Omit<import("better-auth").BetterAuthRateLimitOptions, "window" | "enabled" | "max" | "storage">;
|
|
184
178
|
};
|
|
185
179
|
options: {
|
|
186
|
-
emailValidation: {
|
|
187
|
-
enabled?: boolean;
|
|
188
|
-
strictness?: "low" | "medium" | "high";
|
|
189
|
-
action?: SecurityAction;
|
|
190
|
-
domainAllowlist?: string[];
|
|
191
|
-
} | undefined;
|
|
192
|
-
emailNormalization: {
|
|
193
|
-
enabled?: boolean;
|
|
194
|
-
} | undefined;
|
|
195
180
|
rateLimit: {
|
|
196
181
|
customRules: {
|
|
197
182
|
[key: string]: false | BetterAuthRateLimitRule | ((request: Request, currentRule: BetterAuthRateLimitRule) => import("@better-auth/core").Awaitable<false | BetterAuthRateLimitRule>);
|
|
@@ -276,6 +261,15 @@ declare const sentinel: (options?: SentinelOptions) => {
|
|
|
276
261
|
};
|
|
277
262
|
};
|
|
278
263
|
};
|
|
264
|
+
emailNormalization?: {
|
|
265
|
+
enabled?: boolean;
|
|
266
|
+
} | undefined;
|
|
267
|
+
emailValidation?: {
|
|
268
|
+
enabled?: boolean;
|
|
269
|
+
strictness?: "low" | "medium" | "high";
|
|
270
|
+
action?: SecurityAction;
|
|
271
|
+
domainAllowlist?: string[];
|
|
272
|
+
} | undefined;
|
|
279
273
|
};
|
|
280
274
|
};
|
|
281
275
|
hooks: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@better-auth/infra",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"description": "Dashboard and analytics plugin for Better Auth",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"types": "dist/index.d.mts",
|
|
9
9
|
"sideEffects": false,
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build": "tsdown",
|
|
12
|
-
"dev": "tsdown --watch --no-clean",
|
|
11
|
+
"build": "bun --bun tsdown",
|
|
12
|
+
"dev": "bun --bun tsdown --watch --no-clean",
|
|
13
13
|
"typecheck": "tsc --noEmit",
|
|
14
14
|
"test": "bun test --parallel",
|
|
15
15
|
"test:watch": "bun test --watch",
|
|
@@ -17,21 +17,25 @@
|
|
|
17
17
|
},
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
|
+
"@infra/source": "./src/index.ts",
|
|
20
21
|
"types": "./dist/index.d.mts",
|
|
21
22
|
"import": "./dist/index.mjs",
|
|
22
23
|
"default": "./dist/index.mjs"
|
|
23
24
|
},
|
|
24
25
|
"./client": {
|
|
26
|
+
"@infra/source": "./src/client.ts",
|
|
25
27
|
"types": "./dist/client.d.mts",
|
|
26
28
|
"import": "./dist/client.mjs",
|
|
27
29
|
"default": "./dist/client.mjs"
|
|
28
30
|
},
|
|
29
31
|
"./email": {
|
|
32
|
+
"@infra/source": "./src/email.ts",
|
|
30
33
|
"types": "./dist/email.d.mts",
|
|
31
34
|
"import": "./dist/email.mjs",
|
|
32
35
|
"default": "./dist/email.mjs"
|
|
33
36
|
},
|
|
34
37
|
"./native": {
|
|
38
|
+
"@infra/source": "./src/native.ts",
|
|
35
39
|
"types": "./dist/native.d.mts",
|
|
36
40
|
"import": "./dist/native.mjs",
|
|
37
41
|
"default": "./dist/native.mjs"
|
|
@@ -75,7 +79,7 @@
|
|
|
75
79
|
"msw": "^2.14.6",
|
|
76
80
|
"tsdown": "^0.22.14",
|
|
77
81
|
"typescript": "^6.0.3",
|
|
78
|
-
"zod": "4.
|
|
82
|
+
"zod": "4.5.4"
|
|
79
83
|
},
|
|
80
84
|
"dependencies": {
|
|
81
85
|
"@better-auth/utils": "^0.4.2",
|
|
@@ -83,7 +87,7 @@
|
|
|
83
87
|
"@noble/hashes": "^2.2.0",
|
|
84
88
|
"@xmldom/xmldom": "^0.9.10",
|
|
85
89
|
"better-call": "1.3.7",
|
|
86
|
-
"jose": "^6.2.
|
|
90
|
+
"jose": "^6.2.10",
|
|
87
91
|
"libphonenumber-js": "^1.13.11"
|
|
88
92
|
},
|
|
89
93
|
"peerDependencies": {
|