Remove unnecessary bcryptjs module usage

This commit is contained in:
davide-acanfora 2024-05-27 19:24:11 +02:00 committed by Philip H
parent 859dd2f25b
commit c26b536b65
3 changed files with 0 additions and 17 deletions

View file

@ -1,6 +1,5 @@
'use strict';
const bcrypt = require('bcryptjs');
const crypto = require('node:crypto');
const { createServer } = require('node:http');
const { stat, readFile } = require('node:fs/promises');
@ -118,15 +117,6 @@ module.exports = class Server {
return next();
}
if (req.url.startsWith('/api/') && req.headers['authorization']) {
if (bcrypt.compareSync(req.headers['authorization'], bcrypt.hashSync(PASSWORD, 10))) {
return next();
}
return res.status(401).json({
error: 'Incorrect Password',
});
}
return res.status(401).json({
error: 'Not Logged In',
});