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/forgotPassword.js

14 lines
385 B
JavaScript
Raw Permalink Normal View History

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