File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/hooks/use-auth/use-auth-login Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,13 @@ const isCommonErrorResponse = (e: unknown): e is CommonErrorResponse => {
4848} ;
4949
5050export const useLogin = ( ) => {
51- const _router = useRouter ( ) ;
51+ const router = useRouter ( ) ;
5252 const searchParams = useSearchParams ( ) ;
5353
5454 const [ loginError , setLoginError ] = useState < string | null > ( null ) ;
5555 const clearLoginError = useCallback ( ( ) => setLoginError ( null ) , [ ] ) ;
5656
57- const { setIsAuthenticated } = useAuth ( ) ;
57+ const { setIsAuthenticated : _ } = useAuth ( ) ;
5858
5959 const handleLogin = async ( payload : LoginRequest , formApi : { reset : ( ) => void } ) => {
6060 setLoginError ( null ) ;
@@ -72,10 +72,11 @@ export const useLogin = () => {
7272
7373 formApi . reset ( ) ;
7474
75- setIsAuthenticated ( true ) ;
75+ // setIsAuthenticated(true);
7676
7777 const nextPath = normalizePath ( searchParams . get ( 'path' ) ) ;
78- window . location . href = nextPath ;
78+ // window.location.href = nextPath;
79+ router . replace ( nextPath ) ;
7980 } catch ( error ) {
8081 if ( isCommonErrorResponse ( error ) ) {
8182 console . error ( '[LOGIN ERROR]' , error . errorCode , error . detail ) ;
You can’t perform that action at this time.
0 commit comments