mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
fix: update reset token query
This commit is contained in:
@ -20,12 +20,12 @@ export const forgotPassword = async ({ email }: TForgotPasswordFormSchema) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find a token that was created in the last day and hasn't expired
|
// Find a token that was created in the last hour and hasn't expired
|
||||||
const existingToken = await prisma.passwordResetToken.findFirst({
|
const existingToken = await prisma.passwordResetToken.findFirst({
|
||||||
where: {
|
where: {
|
||||||
userId: user.id,
|
userId: user.id,
|
||||||
expiry: {
|
expiry: {
|
||||||
lt: new Date(),
|
gt: new Date(),
|
||||||
},
|
},
|
||||||
createdAt: {
|
createdAt: {
|
||||||
gt: new Date(Date.now() - ONE_HOUR),
|
gt: new Date(Date.now() - ONE_HOUR),
|
||||||
|
|||||||
Reference in New Issue
Block a user