allow setting the DisplayName property for newly provisioned peers (#507) (#511)

This commit is contained in:
h44z
2025-09-03 19:34:58 +02:00
committed by GitHub
parent 098a9fe23e
commit c79a6c83a8
7 changed files with 63 additions and 1 deletions

View File

@@ -162,7 +162,11 @@ func (p ProvisioningService) NewPeer(ctx context.Context, req models.Provisionin
if req.PresharedKey != "" {
peer.PresharedKey = domain.PreSharedKey(req.PresharedKey)
}
peer.GenerateDisplayName("API")
if req.DisplayName == "" {
peer.GenerateDisplayName("API")
} else {
peer.DisplayName = req.DisplayName
}
// save new peer
peer, err = p.peers.CreatePeer(ctx, peer)