Commit 676ee76
authored
Upgrade Better Auth to 1.7.4 and realign the auth schema (#836)
Better Auth 1.7.3 reverted the account.issuer column that 1.7.0 through
1.7.2 introduced; accounts are keyed on (providerId, accountId) again as
in 1.6. Migration 0007 shipped the issuer column as NOT NULL, so on 1.7.3+
every sign-up and account link would fail on that constraint. Migration
0013 drops the unique index first, as the upgrade guide requires, then
drops the column. The ORCID accountIssuer option is gone and the OAuth
relay carries and looks up the (providerId, accountId) key only.
1.7.3 also validates the drizzle schema on init in every environment and
rejects auth requests on a mismatch. That surfaced three twoFactor
columns the plugin has expected since 1.7.0 but our table never had:
verified, failedVerificationCount and lockedUntil. Production has no
two-factor enrolments yet, so nobody hit it, but the first verify would
have failed. The same migration adds them.
Also in 1.7.3 and 1.7.4: a Cloudflare social provider, isPasswordCompromised
for custom flows, a getSession fix when cookie caching is off, and
Vitest 5 support in the test utilities.
Deploy note: CI migrates before it deploys, so the outgoing 1.7.2 worker
runs against the new schema for the length of the deploy. Only sign-ups
and account links in that window are affected.
Verified: typecheck, lint, shared 332, workers 126, web unit 630, web
server 322, web build all pass.1 parent af5bf75 commit 676ee76
13 files changed
Lines changed: 2083 additions & 101 deletions
File tree
- packages
- db/src
- web
- migrations
- meta
- src
- __tests__/server
- server/functions/__tests__
- workers
- src/auth
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
142 | 141 | | |
143 | 142 | | |
144 | 143 | | |
| |||
153 | 152 | | |
154 | 153 | | |
155 | 154 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
| 155 | + | |
160 | 156 | | |
161 | 157 | | |
162 | 158 | | |
| |||
312 | 308 | | |
313 | 309 | | |
314 | 310 | | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments