mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-05 18:07:14 +00:00
9f96fdb281
AmneziaWG previously fell into these switches' default branch (just checking client.ID isn't empty), unlike WireGuard's own dedicated case validating PublicKey -- even though AmneziaWG clients need a real key exactly like WireGuard ones (defaultAmneziaWGClients already auto-generates/derives PublicKey the same way). Worked in practice only because the real UI form happens to always populate a UUID regardless of protocol; a minimal API payload with just an email and no key would incorrectly pass validation and no clientId for update lookups. Mirror the existing wireguard cases exactly: validate PublicKey on add, use Email as the update-lookup id (matching is always by email regardless, per the existing comment -- this only affects the non-empty check).