Revert "Update change password w/ try/catch" (#3323)
This reverts commit 186532ef2d.
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user