Skip to content

Commit

Permalink
Merge pull request #148 from Sourabh782/password
Browse files Browse the repository at this point in the history
resolved password preset bug in login and signup
  • Loading branch information
ajaynegi45 authored Oct 15, 2024
2 parents c9c6882 + cd03f57 commit f0c7053
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/auth/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { useState } from "react";
import { useEffect, useState } from "react";
import { useForm } from "react-hook-form";
import { zodResolver } from "@hookform/resolvers/zod";
import styles from "./page.module.css";
Expand All @@ -19,10 +19,15 @@ export default function Auth() {
register,
handleSubmit,
formState: { errors },
reset,
} = useForm({
resolver: zodResolver(isSignup ? signupSchema : loginSchema),
});

useEffect(() => {
reset();
}, [isSignup, reset]);

console.log(callback);

const onSubmit = async (data: any) => {
Expand Down

0 comments on commit f0c7053

Please sign in to comment.