fix: update token validity check

This commit is contained in:
Mythie
2023-09-19 13:59:19 +00:00
parent 0ec5976397
commit 6778d2a0da

View File

@ -8,11 +8,12 @@ export const getResetTokenValidity = async ({ token }: GetResetTokenValidityOpti
const found = await prisma.passwordResetToken.findFirst({
select: {
id: true,
expiry: true,
},
where: {
token,
},
});
return !!found;
return !!found && found.expiry > new Date();
};