Skip to content

Commit ae88231

Browse files
authored
Merge pull request #300 from WeGo-Together/chiyoung-fix/login
[Test] router 동작 디버깅을 위한 로그 출력 구문 추가
2 parents b3a6ade + b9a43ea commit ae88231

File tree

1 file changed

+11
-3
lines changed
  • src/hooks/use-auth/use-auth-login

1 file changed

+11
-3
lines changed

src/hooks/use-auth/use-auth-login/index.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export const useLogin = () => {
5656

5757
const { setIsAuthenticated: _ } = useAuth();
5858

59-
const handleLogin = async (payload: LoginRequest, formApi: { reset: () => void }) => {
59+
const handleLogin = async (payload: LoginRequest, _formApi: { reset: () => void }) => {
6060
setLoginError(null);
6161

6262
try {
@@ -70,13 +70,21 @@ export const useLogin = () => {
7070
secure: process.env.NODE_ENV === 'production',
7171
});
7272

73-
formApi.reset();
73+
// formApi.reset();
7474

7575
// setIsAuthenticated(true);
7676

7777
const nextPath = normalizePath(searchParams.get('path'));
7878
// window.location.href = nextPath;
79-
router.replace(nextPath);
79+
console.log('[LOGIN] nextPath:', nextPath);
80+
console.log('[LOGIN] router object:', router);
81+
console.log('[LOGIN] typeof router.replace:', typeof router.replace);
82+
try {
83+
router.replace(nextPath);
84+
console.log('[LOGIN] router.replace called successfully');
85+
} catch (e) {
86+
console.error('[LOGIN] router.replace threw error:', e);
87+
}
8088
} catch (error) {
8189
if (isCommonErrorResponse(error)) {
8290
console.error('[LOGIN ERROR]', error.errorCode, error.detail);

0 commit comments

Comments
 (0)