Skip to content

Commit 3175565

Browse files
committed
Fix on login code
1 parent 2171f06 commit 3175565

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/routes/PrivateRoute.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ import HeroComponent from "../components/HeroComponent";
88
const PrivateRoute = ({ children, location, isLoggedUser, user, isIdTokenAlive, ...rest}) => {
99

1010
if (!isLoggedUser) {
11-
doLogin(`${location.pathname}`);
11+
// do login after page is loaded and GA is called
12+
if(typeof window !== 'undefined') {
13+
window.setTimeout(() => {
14+
doLogin(`${location.pathname}`);
15+
}, 3000);
16+
}
1217
return <HeroComponent title={'Checking Credentials ...'}/>
1318
}
1419

0 commit comments

Comments
 (0)