@ingram-tech/nk-auth 0.18.0 → 0.19.1

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/README.md +15 -1
  2. package/package.json +11 -11
package/README.md CHANGED
@@ -117,7 +117,7 @@ const db = await createTestDb({
117
117
 
118
118
  `better-auth` and `@better-auth/*` move **only with nk-auth**, and a site pins
119
119
  them to the exact version nk-auth's `peerDependencies` names (currently
120
- `1.7.4`), never a range. `nk doctor` fails on a site whose pin differs, and on
120
+ `1.7.7`), never a range. `nk doctor` fails on a site whose pin differs, and on
121
121
  a range. The reason is the schema: a Better Auth version that changes a table
122
122
  ships here as the next `000N_*.sql` in the chain, with `src/migrations.test.ts`
123
123
  diffing the applied chain against that version's `getAuthTables()`, so package
@@ -159,6 +159,20 @@ database applies 0002 and 0003 back to back, and where 0002 refuses a provider,
159
159
  set `issuer` to any placeholder: the value is never read again. Dropping the
160
160
  column is a later, optional delta, possible once no 1.7.2 site remains.
161
161
 
162
+ **From 1.7.5, Better Auth checks the schema before every endpoint.** The first
163
+ call into any endpoint, `getSession` included, compares the database with what
164
+ the configuration writes, and while it fails every auth call throws "Database
165
+ schema mismatch". It fails on a missing table or column, and also on a column
166
+ Better Auth does not write that is NOT NULL with no default. So a site that
167
+ owns its auth tables in its own chain (not this shipped one) must make sure no
168
+ such column survives: a 0002-style NOT NULL `account.issuer` with no 0003-style
169
+ relax breaks sign-in outright, not just sign-up. The check runs once per
170
+ process and caches a clean result. It needs a database: a unit test that
171
+ reaches a real `getSession` without one now throws instead of returning
172
+ `null`, so mock the session seam there. `advanced.database.validateSchema:
173
+ false` turns the check off, but it is the guard that turns this drift into a
174
+ loud error instead of failed inserts, so keep it on in production.
175
+
162
176
  > **Adopting from the old copy-in model?** Earlier versions told you to `cp` the
163
177
  > baseline into your own `drizzle/` chain. If you already did, keep that file
164
178
  > (deleting an applied migration causes journal drift) and just add the auth-chain
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ingram-tech/nk-auth",
3
- "version": "0.18.0",
3
+ "version": "0.19.1",
4
4
  "description": "The Ingram Better Auth foundation: composable presets (org, dual-shape JWT, active-org hooks, pg pool) for Next.js sites.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -69,14 +69,14 @@
69
69
  "test": "vitest run"
70
70
  },
71
71
  "dependencies": {
72
- "@ingram-tech/nk-db": "^2.2.0",
72
+ "@ingram-tech/nk-db": "^2.3.0",
73
73
  "bcrypt": "^6.0.0",
74
74
  "jose": "^6.2.12",
75
75
  "zod": "^4.6.4"
76
76
  },
77
77
  "peerDependencies": {
78
- "@better-auth/passkey": "1.7.4",
79
- "better-auth": "1.7.4",
78
+ "@better-auth/passkey": "1.7.7",
79
+ "better-auth": "1.7.7",
80
80
  "next": "^15.0.0 || ^16.0.0",
81
81
  "pg": "^8.13.0",
82
82
  "react": "^18.0.0 || ^19.0.0"
@@ -96,17 +96,17 @@
96
96
  }
97
97
  },
98
98
  "devDependencies": {
99
- "@better-auth/passkey": "1.7.4",
100
- "@ingram-tech/nk-dev": "0.18.0",
99
+ "@better-auth/passkey": "1.7.7",
100
+ "@ingram-tech/nk-dev": "0.19.0",
101
101
  "@types/bcrypt": "^6.0.0",
102
- "@types/node": "^26.5.1",
102
+ "@types/node": "^26.6.4",
103
103
  "@types/pg": "^8.23.1",
104
104
  "@types/react": "^19.3.0",
105
- "better-auth": "1.7.4",
106
- "next": "^16.3.5",
107
- "pg": "^8.23.0",
105
+ "better-auth": "1.7.7",
106
+ "next": "^16.3.8",
107
+ "pg": "^8.23.1",
108
108
  "react": "^19.3.0",
109
109
  "typescript": "^7.0.2",
110
- "vitest": "^5.0.0"
110
+ "vitest": "^5.0.3"
111
111
  }
112
112
  }