@aphexcms/auth 0.2.1 → 0.3.0-next.20261109083516
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/README.md +1 -1
- package/dist/client.d.ts +738 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +48 -0
- package/dist/client.js.map +1 -0
- package/dist/email/link-emails.d.ts +4 -0
- package/dist/email/link-emails.d.ts.map +1 -0
- package/dist/email/link-emails.js +10 -0
- package/dist/email/link-emails.js.map +1 -0
- package/dist/index.d.ts +26 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +57 -4
- package/dist/index.js.map +1 -1
- package/dist/instance.d.ts +3 -8
- package/dist/instance.d.ts.map +1 -1
- package/dist/instance.js +50 -16
- package/dist/instance.js.map +1 -1
- package/dist/service.d.ts +2 -1
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +13 -5
- package/dist/service.js.map +1 -1
- package/dist/types.d.ts +37 -7
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -7
package/dist/types.d.ts
CHANGED
|
@@ -32,9 +32,12 @@ export interface AuthCodeEmailTemplate {
|
|
|
32
32
|
* already export from `src/lib/server/email` — pass that object straight in.
|
|
33
33
|
*/
|
|
34
34
|
export interface AuthEmailConfig {
|
|
35
|
-
from
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
/** Defaults to the email adapter's `from`. */
|
|
36
|
+
from?: string;
|
|
37
|
+
/** Defaults to a plain built-in template. */
|
|
38
|
+
passwordReset?: AuthEmailTemplate;
|
|
39
|
+
/** Defaults to a plain built-in template. */
|
|
40
|
+
emailVerification?: AuthEmailTemplate;
|
|
38
41
|
/**
|
|
39
42
|
* Branding for the second-factor code email. Optional — when omitted, a plain
|
|
40
43
|
* built-in template is used instead, so email 2FA works without writing one.
|
|
@@ -187,6 +190,26 @@ export interface AphexAuthConfig {
|
|
|
187
190
|
* and their option shapes can't drift out of step with the installed version.
|
|
188
191
|
*/
|
|
189
192
|
socialProviders?: BetterAuthOptions['socialProviders'];
|
|
193
|
+
/**
|
|
194
|
+
* Headers to read the client's IP address from, in order — the first one
|
|
195
|
+
* present wins. Rate limiting is per-IP, so without a resolvable address every
|
|
196
|
+
* caller shares one bucket per path and the per-endpoint limits stop meaning
|
|
197
|
+
* what they say: `/request-password-reset` at 2/minute becomes two requests per
|
|
198
|
+
* minute *for the whole instance*, which one person can exhaust and an attacker
|
|
199
|
+
* can hold shut.
|
|
200
|
+
*
|
|
201
|
+
* Omit this and the platform is detected instead — `x-forwarded-for` is trusted
|
|
202
|
+
* when Railway, Render or Fly's own environment variables are present, and no
|
|
203
|
+
* header is trusted otherwise. Set it explicitly for anything else: `nginx` and
|
|
204
|
+
* Coolify also use `x-forwarded-for`, Cloudflare adds `cf-connecting-ip`.
|
|
205
|
+
*
|
|
206
|
+
* **Only name a header your proxy overwrites.** A forwarding header is
|
|
207
|
+
* client-supplied on any request that reaches the app directly, so trusting one
|
|
208
|
+
* on a directly-reachable deployment lets a caller pick their own IP and evade
|
|
209
|
+
* rate limiting entirely — worse than the shared bucket it replaces. That is
|
|
210
|
+
* why this is not defaulted to `x-forwarded-for` for everyone.
|
|
211
|
+
*/
|
|
212
|
+
ipAddressHeaders?: string[];
|
|
190
213
|
/**
|
|
191
214
|
* Two-factor authentication via an authenticator app (TOTP), plus backup codes.
|
|
192
215
|
* Off unless set — `true` takes better-auth's defaults, an object configures it.
|
|
@@ -213,15 +236,22 @@ export interface AphexAuthConfig {
|
|
|
213
236
|
* Full escape hatch. Receives the assembled better-auth options and returns
|
|
214
237
|
* what should actually be passed to `betterAuth()`.
|
|
215
238
|
*
|
|
216
|
-
* This exists so the wrapper never becomes a ceiling: better-auth
|
|
217
|
-
*
|
|
218
|
-
* plugins,
|
|
219
|
-
*
|
|
239
|
+
* This exists so the wrapper never becomes a ceiling: any option better-auth has
|
|
240
|
+
* (plugins, providers) is reachable here without a release of this package. To
|
|
241
|
+
* import its plugins, add `better-auth` to your app at a version in this package's
|
|
242
|
+
* range, so that you share one copy.
|
|
220
243
|
*
|
|
221
244
|
* ```ts
|
|
222
245
|
* betterAuth: (base) => ({ ...base, plugins: [...base.plugins, twoFactor()] })
|
|
223
246
|
* ```
|
|
224
247
|
*/
|
|
225
248
|
betterAuth?: (base: Record<string, unknown>) => Record<string, unknown>;
|
|
249
|
+
/**
|
|
250
|
+
* Where the password reset page is served, as a prefix of `/reset-password/<token>`.
|
|
251
|
+
* `aphexAuth()` sets this to `/admin`, where core serves the page.
|
|
252
|
+
*
|
|
253
|
+
* @default ''
|
|
254
|
+
*/
|
|
255
|
+
authPagesPath?: string;
|
|
226
256
|
}
|
|
227
257
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EACX,eAAe,EACf,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,MAAM,2BAA2B,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnF;AAED;;;;;GAKG;AACH,MAAM,WAAW,qBAAqB;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,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B;;;;;;;;;;;;OAYG;IACH,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAExE;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aphexcms/auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0-next.20261109083516",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -20,6 +20,11 @@
|
|
|
20
20
|
"import": "./dist/index.js",
|
|
21
21
|
"default": "./dist/index.js"
|
|
22
22
|
},
|
|
23
|
+
"./client": {
|
|
24
|
+
"types": "./dist/client.d.ts",
|
|
25
|
+
"import": "./dist/client.js",
|
|
26
|
+
"default": "./dist/client.js"
|
|
27
|
+
},
|
|
23
28
|
"./schema/pg": {
|
|
24
29
|
"types": "./dist/schema/pg.d.ts",
|
|
25
30
|
"import": "./dist/schema/pg.js",
|
|
@@ -35,20 +40,20 @@
|
|
|
35
40
|
"dist"
|
|
36
41
|
],
|
|
37
42
|
"peerDependencies": {
|
|
38
|
-
"@aphexcms/cms-core": "
|
|
43
|
+
"@aphexcms/cms-core": "12.0.0-next.20261109083516"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
39
46
|
"@better-auth/api-key": "^1.6.25",
|
|
40
47
|
"better-auth": "^1.6.25",
|
|
41
48
|
"drizzle-orm": "^0.45.2"
|
|
42
49
|
},
|
|
43
50
|
"devDependencies": {
|
|
44
|
-
"@better-auth/api-key": "^1.6.25",
|
|
45
|
-
"better-auth": "^1.6.25",
|
|
46
|
-
"drizzle-orm": "^0.45.2",
|
|
47
51
|
"typescript": "^5.9.3",
|
|
48
|
-
"@aphexcms/cms-core": "^
|
|
52
|
+
"@aphexcms/cms-core": "^12.0.0-next.20261109083516"
|
|
49
53
|
},
|
|
50
54
|
"scripts": {
|
|
51
55
|
"build": "tsc",
|
|
52
|
-
"dev
|
|
56
|
+
"dev": "tsc --watch",
|
|
57
|
+
"clean": "rm -rf dist"
|
|
53
58
|
}
|
|
54
59
|
}
|