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