Skip to content

Commit 9107af0

Browse files
author
Nicos
committed
add password check query
Relates #2
1 parent f422fd0 commit 9107af0

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Queries/check_user_password.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const databaseConnection = require("../database/db_connections.js");
2+
3+
const check_user_password = (username, cb) => {
4+
databaseConnection.query(
5+
`SELECT password FROM users WHERE username=$1`,
6+
[username],
7+
(err, res) => {
8+
if (err) cb(err);
9+
else cb(null, res);
10+
}
11+
);
12+
};
13+
14+
module.exports = check_user_password;

0 commit comments

Comments
 (0)