fix: update token validity check
This commit is contained in:
@@ -8,11 +8,12 @@ export const getResetTokenValidity = async ({ token }: GetResetTokenValidityOpti
|
|||||||
const found = await prisma.passwordResetToken.findFirst({
|
const found = await prisma.passwordResetToken.findFirst({
|
||||||
select: {
|
select: {
|
||||||
id: true,
|
id: true,
|
||||||
|
expiry: true,
|
||||||
},
|
},
|
||||||
where: {
|
where: {
|
||||||
token,
|
token,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
return !!found;
|
return !!found && found.expiry > new Date();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user