sdy

update resetPassword

import { prisma, isAuthenticated } from "../../../utils";
import bcrypt from "bcryptjs";
export default {
Mutation: {
......@@ -19,13 +20,14 @@ export default {
// For check new password is right, the two things must be same.
throw new Error("the two password don't match each other, try again");
} else {
const encyptPW = await bcrypt.hash(passwordOne, 10);
await prisma.user.update({
where: {
email,
},
data: {
emailSecret: "",
password: passwordOne,
password: encyptPW,
},
});
}
......