1
0
forked from noxious/server

Finish password reset (hopefully)

This commit is contained in:
2024-11-03 21:54:54 +01:00
parent b9a7f9aa8e
commit 27d8c7cff6
4 changed files with 76 additions and 4 deletions

View File

@ -26,6 +26,19 @@ class PasswordResetTokenRepository {
throw new Error(`Failed to get password reset token by user ID: ${error.message}`)
}
}
async getByToken(token: string): Promise<any> {
try {
return await prisma.passwordResetToken.findFirst({
where: {
token
}
})
} catch (error: any) {
// Handle error
throw new Error(`Failed to get password reset token by token: ${error.message}`)
}
}
}
export default new PasswordResetTokenRepository()