This commit is contained in:
yashrajverma 2021-05-31 13:13:31 +05:30
parent 51238a4d96
commit 812cc70ae9
1 changed files with 17 additions and 9 deletions

View File

@ -224,6 +224,7 @@ module.exports.postSignin = async (req, res, next) => {
console.log("req.body", req.body);
let user = await User.findOne({ email });
if (isGoogle) {
if (user) {
user.isVerified = true;
user = await user.save();
const isMatched = await bcrypt.compare(password, user.password);
@ -239,6 +240,13 @@ module.exports.postSignin = async (req, res, next) => {
});
return;
}
} else {
res.json({
message: "User Doesn't Exists",
type: "error",
});
return;
}
} else {
if (user) {
if (user.isVerified) {