File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
src/hooks/use-auth/use-auth-login Expand file tree Collapse file tree 1 file changed +5
-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,12 +70,14 @@ 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' ) ) ;
78- router . replace ( nextPath ) ;
78+ setTimeout ( ( ) => {
79+ router . replace ( nextPath ) ;
80+ } , 0 ) ;
7981 } catch ( error ) {
8082 if ( isCommonErrorResponse ( error ) ) {
8183 console . error ( '[LOGIN ERROR]' , error . errorCode , error . detail ) ;
You can’t perform that action at this time.
0 commit comments