mirror of
https://github.com/juanfont/headscale.git
synced 2026-07-15 20:40:55 +09:00
78926fbde4
DestroyUser called ListPreAuthKeys(tx) which returns ALL keys in the
database, then deleted every one of them. This caused deleting any
single user to wipe all pre-auth keys system-wide.
Fix: query only keys belonging to the user being deleted using
tx.Where("user_id = ?", uid).Find(&keys).
Fixes: https://github.com/juanfont/headscale/issues/3154