File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
src/hooks/use-auth/use-auth-login Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments