sdy

update resetPassword

......@@ -4,7 +4,6 @@ import bcrypt from "bcryptjs";
export default {
Mutation: {
resetPassword: async (_, args, { request }) => {
console.log(request);
isAuthenticated(request);
const { emailSecret, email, passwordOne, passwordTwo } = args;
const user = await prisma.user.findOne({
......@@ -12,8 +11,7 @@ export default {
email,
},
});
const encryptSecret = await bcrypt.hash(user.emailSecret, 10);
if (encryptSecret !== emailSecret) {
if (user.emailSecret !== emailSecret) {
throw new Error(
"not vaild secret value!, input another value or resend email"
);
......