1
0
mirror of synced 2025-12-19 18:11:23 -05:00

Revert "Update change password w/ try/catch" (#3323)

This reverts commit 186532ef2d.
This commit is contained in:
Blake Bayer
2022-04-29 08:31:23 -04:00
committed by GitHub
parent 186532ef2d
commit 45b38cc836

View File

@@ -10,11 +10,7 @@ export default resolver.pipe(
const user = await db.user.findFirst({ where: { id: ctx.session.userId! } })
if (!user) throw new NotFoundError()
try {
await authenticateUser(user.email, currentPassword)
} catch (error: any) {
throw new Error("Invalid Password")
}
await authenticateUser(user.email, currentPassword)
const hashedPassword = await SecurePassword.hash(newPassword.trim())
await db.user.update({