File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
src/containers/Auth/Login Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 1
1
import { useState , useContext , useEffect } from 'react' ;
2
- import { useNavigate , useLocation } from 'react-router' ;
2
+ import { useLocation , redirect } from 'react-router' ;
3
3
import axios from 'axios' ;
4
4
import * as Yup from 'yup' ;
5
5
import { useLazyQuery } from '@apollo/client' ;
@@ -29,7 +29,6 @@ export const Login = () => {
29
29
const { setAuthenticated } = useContext ( SessionContext ) ;
30
30
const [ authError , setAuthError ] = useState ( '' ) ;
31
31
const { i18n, t } = useTranslation ( ) ;
32
- const navigate = useNavigate ( ) ;
33
32
const location : any = useLocation ( ) ;
34
33
35
34
// function to unauthorize access
@@ -73,10 +72,10 @@ export const Login = () => {
73
72
}
74
73
75
74
if ( location . state ?. to ) {
76
- navigate ( location . state . to ) ;
75
+ redirect ( location . state . to ) ;
77
76
} else {
78
77
// redirect to chat
79
- navigate ( '/chat' ) ;
78
+ redirect ( '/chat' ) ;
80
79
}
81
80
}
82
81
}
You can’t perform that action at this time.
0 commit comments