FIX: JWT validation can return null as well

pull/4/head
Florian Brede 2021-05-21 02:58:06 +02:00
parent c507c6166a
commit 972e6719e9
1 changed files with 1 additions and 1 deletions

View File

@ -300,7 +300,7 @@ app.put('/backend/post_upload', bodyParser.raw({
let decoded = device.public_key ? await authenticationController.validateJWT(req.headers.authorization, device.public_key) : null;
if ((decoded === undefined || decoded.identity !== req.params.dongleId)) {
if ((decoded == undefined || decoded.identity !== req.params.dongleId)) {
logger.info(`HTTP.UPLOAD_URL JWT authorization failed, token: ${auth} device: ${JSON.stringify(device)}, decoded: ${JSON.stringify(decoded)}`);
return res.send('Unauthorized.').status(400)
}