1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
letu/sockets/email/checkResend.js

14 lines
487 B
JavaScript

const models = require("../../models");
const emailCheck = require("../utils/emailCheck");
module.exports = socket => {
return async (data) => {
let user = await models.User.findByPk(data.email);
if (!user)
socket.emit("checkResend", {error: {message: "not_found"}});
else if (user.emailVerified)
socket.emit("checkResend", {error: {message: "verified_email"}});
else
await emailCheck(socket, user, null);
}
}