Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit acaf4d7

Browse files
if session is valid, then redirect to todo done, previously it was in empty page
1 parent 27668e8 commit acaf4d7

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/components/common/AuthRoute.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
import React from 'react';
2-
import { useSelector } from 'react-redux';
32
import { Route, Redirect } from 'react-router-dom';
43
import { SESSION } from '../../services';
54

65
function AuthRoute({ children, ...rest }) {
7-
const { recentlyVisitedUrl } = useSelector((state) => state.history);
8-
96
if (SESSION.isLoggedIn()) {
107
return (
118
<Redirect
129
to={{
13-
pathname: recentlyVisitedUrl,
10+
pathname: '/todo',
1411
}}
1512
/>
1613
);

0 commit comments

Comments
 (0)