mirror of
https://github.com/wg-easy/wg-easy.git
synced 2025-10-05 15:47:18 +08:00
Remove unnecessary bcryptjs module usage
This commit is contained in:

committed by
Philip H

parent
859dd2f25b
commit
c26b536b65
@@ -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',
|
||||
});
|
||||
|
Reference in New Issue
Block a user