mirror of
https://github.com/documenso/documenso.git
synced 2025-11-10 12:32:34 +10:00
20 lines
401 B
TypeScript
20 lines
401 B
TypeScript
import { prisma } from '@documenso/prisma';
|
|
|
|
type GetResetTokenValidityOptions = {
|
|
token: string;
|
|
};
|
|
|
|
export const getResetTokenValidity = async ({ token }: GetResetTokenValidityOptions) => {
|
|
const found = await prisma.passwordResetToken.findFirst({
|
|
select: {
|
|
id: true,
|
|
expiry: true,
|
|
},
|
|
where: {
|
|
token,
|
|
},
|
|
});
|
|
|
|
return !!found && found.expiry > new Date();
|
|
};
|