forked from mirrors/amnezia-wg-easy
Remove unnecessary bcryptjs module usage
This commit is contained in:
parent
859dd2f25b
commit
c26b536b65
3 changed files with 0 additions and 17 deletions
|
@ -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',
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue