Commit 9579935
committed
fix(runtime): SSO handoff value must be unique (embed token)
The cloud-minted SSO handoff (`sso_as_owner` / 'Open' button) writes a
`sys_verification` row whose unique token lives in `identifier`
(`sso-handoff:<token>`) while `value` held a static JSON payload
{email,name,by,envId}. But `sys_verification.value` carries a UNIQUE index
(it is the OTP/token column for email-verification flows), so opening the
SAME environment twice as the same owner produced identical value JSON and
the second issuance failed with:
UNIQUE constraint failed: sys_verification.value
i.e. an operator opening their env a second time got a 500.
Embed the unique handoff token (`t`) in the value payload so each issuance
is distinct. The sso-exchange consumer only reads email/name, so the extra
field is inert.1 parent 60af8ac commit 9579935
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
260 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
261 | 268 | | |
262 | 269 | | |
263 | 270 | | |
| |||
0 commit comments