diff --git a/backend/__pycache__/database.cpython-313.pyc b/backend/__pycache__/database.cpython-313.pyc index 96cc71b..5855d1c 100644 Binary files a/backend/__pycache__/database.cpython-313.pyc and b/backend/__pycache__/database.cpython-313.pyc differ diff --git a/backend/__pycache__/main.cpython-313.pyc b/backend/__pycache__/main.cpython-313.pyc index aab14f7..c7ab795 100644 Binary files a/backend/__pycache__/main.cpython-313.pyc and b/backend/__pycache__/main.cpython-313.pyc differ diff --git a/frontend/src/app/(auth)/signin/page.tsx b/frontend/src/app/(auth)/signin/page.tsx index 3de81d0..9db3e71 100644 --- a/frontend/src/app/(auth)/signin/page.tsx +++ b/frontend/src/app/(auth)/signin/page.tsx @@ -17,7 +17,7 @@ export default function Page() { }); // const [signIn, {isError, isSuccess, error, data}] = useSignInMutation(); - const { mutate: signInMutation, isError, error, data } = useMutation({ + const { mutate: signInMutation, isError,isSuccess, error, data } = useMutation({ mutationFn: ({username, password}: {username: string, password: string}) => signIn(username, password), }); @@ -39,7 +39,7 @@ export default function Page() { return; } - if(data){ + if(isSuccess){ alert('로그인에 성공했습니다.'); console.log('data:', data); diff --git a/frontend/src/app/(auth)/signup/page.tsx b/frontend/src/app/(auth)/signup/page.tsx index 7443fad..2e375fc 100644 --- a/frontend/src/app/(auth)/signup/page.tsx +++ b/frontend/src/app/(auth)/signup/page.tsx @@ -18,7 +18,7 @@ const INITIAL_FORM = { export default function Page() { const [form, setForm] = useState(INITIAL_FORM); - const { mutate: signUpMutation, isError, error } = useMutation({ + const { mutate: signUpMutation, isError, isSuccess, error } = useMutation({ mutationFn: ({username, password}: {username: string, password: string}) => signUp(username, password), }); @@ -44,8 +44,10 @@ export default function Page() { return; } - alert('회원가입에 성공했습니다.'); - router.push('/signin'); + if(isSuccess){ + alert('회원가입에 성공했습니다.'); + router.push('/signin'); + } }; return (