summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJannik Schönartz2018-11-22 00:09:22 +0100
committerJannik Schönartz2018-11-22 00:09:22 +0100
commit34129c58704e9de1edab2bc50dd72383940ce0e2 (patch)
tree37d2a24663bcd95cb640c2f1c926e3a5d8da3e4c /server
parent[external-backends] Fix: Delete clients in the backend is now working properly. (diff)
downloadbas-34129c58704e9de1edab2bc50dd72383940ce0e2.tar.gz
bas-34129c58704e9de1edab2bc50dd72383940ce0e2.tar.xz
bas-34129c58704e9de1edab2bc50dd72383940ce0e2.zip
eslint fixes :)
Diffstat (limited to 'server')
-rw-r--r--server/api/registrations.js12
-rw-r--r--server/lib/authentication.js2
2 files changed, 7 insertions, 7 deletions
diff --git a/server/api/registrations.js b/server/api/registrations.js
index 6897dc9..74e7d84 100644
--- a/server/api/registrations.js
+++ b/server/api/registrations.js
@@ -4,7 +4,7 @@ var express = require('express')
var router = express.Router()
var noAuthRouter = express.Router()
var db = require(path.join(__appdir, 'lib', 'sequelize'))
-const ExternalBackends = require(path.join(__appdir, 'lib', 'external-backends'))
+// const ExternalBackends = require(path.join(__appdir, 'lib', 'external-backends'))
const backendHelper = require(path.join(__appdir, 'lib', 'external-backends', 'backendhelper'))
// GET requests.
@@ -16,14 +16,14 @@ noAuthRouter.get('/', (req, res) => {
backendHelper.deleteClients().then(r => {
res.send(r)
})
- /*
- db.backend.findOne({ where: { id: 1 } }).then(result => {
+ /*
+ db.backend.findOne({ where: { id: 1 } }).then(result => {
const b = new ExternalBackends()
const instance = b.getInstance(result.type)
instance.getClient(result.credentials, {}).then(result => {
res.status(200).send(result)
})
- })*/
+ }) */
})
/*
@@ -129,7 +129,7 @@ noAuthRouter.post('/add', (req, res) => {
const name = req.body.name
const parentId = req.body.id
db.client.findOne({ where: { uuid: uuid } }).then(client => {
- if (client) res.send('#!ipxe\nchain https://bas.intra.uni-freiburg.de/api/configloader/${uuid}')
+ if (client) res.send(`#!ipxe\nchain https://bas.intra.uni-freiburg.de/api/configloader/\${uuid}`)
else {
var groupids = []
if (parentId) groupids = [parentId]
@@ -154,7 +154,7 @@ noAuthRouter.post('/add', (req, res) => {
}
})
})
- res.send('#!ipxe\nchain https://bas.intra.uni-freiburg.de/api/configloader/${uuid}')
+ res.send(`#!ipxe\nchain https://bas.intra.uni-freiburg.de/api/configloader/\${uuid}`)
})
})
}
diff --git a/server/lib/authentication.js b/server/lib/authentication.js
index a9ee4ef..5623b1e 100644
--- a/server/lib/authentication.js
+++ b/server/lib/authentication.js
@@ -119,7 +119,7 @@ function verifyUser (res, username, password, callback) {
// Verify & improving the hash.
verifyHash(res, userPassword, hash, user.id, function () {
- jwt.sign({user}, config.secret, { expiresIn: '12h' }, (err, token) => {
+ jwt.sign({ user }, config.secret, { expiresIn: '12h' }, (err, token) => {
if (err) return res.status(500).send({ auth: false, status: 'JWT_ERROR', error_message: 'Jwt sign failed.' })
return callback(token)
})