@remit/auth-service 0.0.2 → 0.0.4

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/auth.ts +9 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remit/auth-service",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "better-auth identity service for the Postgres-parity stack (pg-parity)",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -29,7 +29,6 @@
29
29
  },
30
30
  "devDependencies": {
31
31
  "@better-auth/cli": "^1.4.21",
32
- "@types/better-sqlite3": "^7.6.13",
33
32
  "drizzle-kit": "^0.31.1",
34
33
  "tsx": "*"
35
34
  },
@@ -38,7 +37,8 @@
38
37
  "better-sqlite3": "^12.11.1",
39
38
  "drizzle-orm": "^0.45.2",
40
39
  "jose": "^6.2.3",
41
- "pg": "^8.0.0"
40
+ "pg": "^8.0.0",
41
+ "@types/better-sqlite3": "^7.6.13"
42
42
  },
43
43
  "license": "MIT",
44
44
  "publishConfig": {
package/src/auth.ts CHANGED
@@ -104,6 +104,15 @@ export const createAuth = async (
104
104
  window: intEnv("BETTER_AUTH_RATE_LIMIT_SIGN_UP_WINDOW", 60),
105
105
  max: intEnv("BETTER_AUTH_RATE_LIMIT_SIGN_UP_MAX", 5),
106
106
  },
107
+ // The token endpoint is the hot path: it is polled per session, per
108
+ // tab, and on every page load, so it needs a far higher ceiling than
109
+ // a generic auth route. The global bucket keyed by IP otherwise
110
+ // throttles a legitimate browser — several tabs, or a NAT'd office —
111
+ // and a throttled mint strands the session in a 401 cascade.
112
+ "/token": {
113
+ window: intEnv("BETTER_AUTH_RATE_LIMIT_TOKEN_WINDOW", 60),
114
+ max: intEnv("BETTER_AUTH_RATE_LIMIT_TOKEN_MAX", 300),
115
+ },
107
116
  },
108
117
  },
109
118
  user: { modelName: "auth_user" },