mirror of
https://framagit.org/les/gancio.git
synced 2025-01-31 16:42:22 +01:00
forgot password on active user only
This commit is contained in:
parent
deb2367a44
commit
25165fd1da
1 changed files with 1 additions and 1 deletions
|
@ -11,7 +11,7 @@ const userController = {
|
|||
|
||||
async forgotPassword (req, res) {
|
||||
const email = req.body.email
|
||||
const user = await User.findOne({ where: { email: { [Op.eq]: email } } })
|
||||
const user = await User.findOne({ where: { email, is_active: true } })
|
||||
if (!user) { return res.sendStatus(200) }
|
||||
|
||||
user.recover_code = crypto.randomBytes(16).toString('hex')
|
||||
|
|
Loading…
Reference in a new issue