mysql db partially integrated

This commit is contained in:
2023-07-15 17:07:15 +02:00
parent 5270317e2d
commit a8cf4ec9a4
6 changed files with 35 additions and 11 deletions

View File

@@ -16,9 +16,9 @@
const bcrypt = require( 'bcrypt' );
const db = require( '../db/db.js' );
module.exports.checkpassword = function checkpassword ( username, password ) {
module.exports.checkpassword = function checkpassword ( email, password ) {
return new Promise( resolve => {
db.getData( 'user', username ).then( data => {
db.getDataSimple( 'user', 'email', email ).then( data => {
bcrypt.compare( password, data ).then( data => {
resolve( data );
} );