fix navigation
This commit is contained in:
parent
f848013787
commit
b73ad65d9a
@ -1,9 +1,11 @@
|
||||
import { useDispatch } from 'react-redux';
|
||||
import { logout } from '../../actions';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
const Header = (props) => {
|
||||
|
||||
const dispatch = useDispatch();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const handleLogoutClick = () => {
|
||||
dispatch(logout())
|
||||
|
@ -48,7 +48,7 @@ const Login = () => {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if(auth != {}) {
|
||||
if(Object.keys(auth).length > 0) {
|
||||
navigate("/dashboard")
|
||||
}
|
||||
})
|
||||
@ -116,6 +116,15 @@ const Login = () => {
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<p>demo account</p>
|
||||
<p>superadmin</p>
|
||||
<p>email: superadmin@superadmin.com</p>
|
||||
<p>password: 12345</p>
|
||||
<p>admin</p>
|
||||
<p>email: admin@admin.com</p>
|
||||
<p>password: 12345</p>
|
||||
<p>email: author@author </p>
|
||||
<p>password: 12345</p>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user