mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 08:47:07 +00:00
Remove unused code
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
const { pool } = require('../connection');
|
||||
const hashPassword = require('./hashPassword');
|
||||
|
||||
const IPUser = Symbol("IPUser");
|
||||
const HostUser = Symbol("HostUser");
|
||||
@@ -54,35 +53,10 @@ async function named (opts = {}) {
|
||||
return await userOfType(NamedUser, opts);
|
||||
}
|
||||
|
||||
async function authenticate (handle, password) {
|
||||
const namedUsers = await named({insecure: true, active: true});
|
||||
|
||||
for (const namedUser of namedUsers) {
|
||||
if (handle == namedUser.name) {
|
||||
const hash = hashPassword(namedUser.id, password);
|
||||
if (hash == namedUser.hash) {
|
||||
delete namedUser.hash;
|
||||
return namedUser;
|
||||
}
|
||||
}
|
||||
}
|
||||
// return undefined;
|
||||
};
|
||||
|
||||
|
||||
|
||||
module.exports = {
|
||||
ip,
|
||||
host,
|
||||
named,
|
||||
|
||||
authenticate,
|
||||
hashPassword,
|
||||
|
||||
list: require('./list'),
|
||||
get: require('./get'),
|
||||
post: require('./post'),
|
||||
put: require('./put'),
|
||||
delete: require('./delete'),
|
||||
create: require('./post'), // synonym
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user