summaryrefslogtreecommitdiffstats
path: root/server/api/registration.js
diff options
context:
space:
mode:
authorJannik Schönartz2019-03-15 15:59:52 +0100
committerJannik Schönartz2019-03-15 15:59:52 +0100
commit07639fbbc1440d8224365a5c0b0ae697989cd0fb (patch)
treeffd523301d993f462dbfdb7c89e84aebf0f65fff /server/api/registration.js
parent[external-backeds] Big idoit rework, to match the updated api (diff)
downloadbas-07639fbbc1440d8224365a5c0b0ae697989cd0fb.tar.gz
bas-07639fbbc1440d8224365a5c0b0ae697989cd0fb.tar.xz
bas-07639fbbc1440d8224365a5c0b0ae697989cd0fb.zip
[server/registration] Add log to the first registration.
Diffstat (limited to 'server/api/registration.js')
-rw-r--r--server/api/registration.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/api/registration.js b/server/api/registration.js
index 3eb36e0..63a3915 100644
--- a/server/api/registration.js
+++ b/server/api/registration.js
@@ -9,6 +9,7 @@ const backendHelper = require(path.join(__appdir, 'lib', 'external-backends', 'b
const ipHelper = require(path.join(__appdir, 'lib', 'iphelper'))
const config = require(path.join(__appdir, 'config', 'config'))
const url = config.https.host + ':' + config.https.port
+const log = require(path.join(__appdir, 'lib', 'log'))
// GET requests.
@@ -137,12 +138,15 @@ noAuthRouter.postAsync('/add', async (req, res) => {
parentIds.forEach(pid => { newClient.addGroup(pid) })
// TODO: check if there are multiple groups which are mapped to a backend if so --> merge conflict
}
+ log({ category: 'CLIENT_REGISTRATION', description: 'Client added successfully.', clientId: newClient.id })
// Add the client to the backends.
var c = { id: newClient.id, title: name, uuid: uuid, network: { mac: mac, ip: ip } }
if (parentIds.length > 0) c.parents = parentIds
if (purpose) c.purpose = purpose
- const result = await backendHelper.addClient(c)
+
+ var result = await backendHelper.addClient(c)
+
if (feedback) res.send(result)
else res.send(`#!ipxe\nchain https://` + url + `/api/configloader/\${uuid}`)
})