remove old, commented implementation of authenticate

This commit is contained in:
2025-07-09 12:13:19 +02:00
parent 0c6dbe30ab
commit dc2d038b1b

View File

@@ -22,32 +22,6 @@ export function decryptToken(token: string) {
} }
export function authenticate(user, pass) { export function authenticate(user, pass) {
// let userData = null;
// if (AUTH[user]) {
// const { password, ...data } = AUTH[user];
//
// // fetch user password from db;
// db.get(get_usr_stmt, [user], (err, row) => {
// console.log(`[row] ${row.name} + ${row.pw}`);
// let stored_pw = row.pw;
// // hash user password
// let hashed_pw = new jsSHA('SHA-512', 'TEXT').update(pass).getHash('HEX');
//
// console.log(`+++ ${stored_pw} || ${hashed_pw} || ${pass}`);
//
// if (hashed_pw && hashed_pw === stored_pw) {
// console.log(`--- SUCCESS`);
// userData = data;
// }
// if (userData == null) return null;
// console.log(`^^^ ${userData}`);
// return createToken({ id: user, ...userData });
// });
// }
//
// if (userData == null) return null;
let token; let token;
// hash user password // hash user password