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
386 B
JavaScript
Raw 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);
}
2020-12-12 18:20:02 +01:00
};