remove old, commented implementation of authenticate
This commit is contained in:
@@ -22,32 +22,6 @@ export function decryptToken(token: string) {
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
// hash user password
|
||||
|
||||
Reference in New Issue
Block a user