Remove tokens on successful password reset
This commit is contained in:
@@ -48,9 +48,9 @@ async function postHandler(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
password: hashedPassword,
|
password: hashedPassword,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
prisma.passwordResetToken.delete({
|
prisma.passwordResetToken.deleteMany({
|
||||||
where: {
|
where: {
|
||||||
token,
|
userId: foundToken.userId,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
|
|||||||
Reference in New Issue
Block a user