Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const checkPassword = (username, password) => {
- return new Promise(async (resolve,reject) => {
- try{
- const userModel = getUserModel();
- const user = await userModel.findOne({where: { username } });
- const correctPassword = validPassword(password,user.password);
- console.log("sanity check corr password " + correctPassword);
- resolve(correctPassword);
- //return a token??
- }
- catch(error) {
- reject(error);
- }
- });
- };
- const isCorrect = await checkPassword(username, password);
- if(correctPassword) {
- console.log("LOGIN SUCCESSFULL");
- } else {
- console.log("LOGIN UNSUCCESSFULL");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement