Commit e8a81f0
fix(identity): sys_verification.value must not be UNIQUE — it breaks OIDC authorize (#2333)
better-auth's oauth-provider stores OIDC authorization codes in the verification
table with `value` = a JSON blob (keyed by user + client + state) that can
legitimately repeat. The UNIQUE index on `value` makes
`/api/v1/auth/oauth2/authorize` fail with `UNIQUE constraint failed:
sys_verification.value` → HTTP 503, which breaks cloud-as-IdP SSO
("Continue with ObjectStack") entirely — the authorize loops forever.
better-auth keys verification lookups on `identifier` (indexed), not `value`,
so a non-unique index on `value` is sufficient.
Found via a local browser E2E of the env→cloud OIDC SSO flow (ADR-0024 D3).
NOTE: existing control-plane DBs already have `uniq_sys_verification_value`;
they need a migration to drop it (schema-sync is additive).
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 635849f commit e8a81f0
1 file changed
Lines changed: 7 additions & 1 deletion
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| |||
0 commit comments