From f6966ee8ced5c7b41bd1a1324868c1b3fd612027 Mon Sep 17 00:00:00 2001 From: Jannik Schönartz Date: Tue, 13 Jul 2021 14:45:40 +0000 Subject: [server/idoit/registration] Change contact from name / lastname to username & cut netmask from ip --- server/api/registration.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'server/api') diff --git a/server/api/registration.js b/server/api/registration.js index 1b5a6d1..5d161b7 100644 --- a/server/api/registration.js +++ b/server/api/registration.js @@ -683,12 +683,15 @@ async function parseHardwareInformation (data) { /* Get network information as fallback for ip */ if (client.networks.length <= 0) { for (let key in data.net) { + // IP v4 and v6 comes with the netmask, so the last 3 chars need to be cut + const ipv4 = data.net[key]['ipv4'] + const ipv6 = data.net[key]['ipv6'] let network = { 'name': key, 'mac': data.net[key]['mac'], - 'ip': data.net[key]['ipv4'], - 'ipv6': data.net[key]['ipv6'], - 'hostname': '' + ...(ipv4 && { 'ip': ipv4.substring(0, ipv4.length - 3) }), + ...(ipv6 && { 'ipv6': ipv6.substring(0, ipv6.length - 3) }), + 'hostname': undefined } client.networks.push(network) } -- cgit v1.2.3-55-g7522