Skip to content

Commit afae655

Browse files
committed
protected route
1 parent 8fa86c1 commit afae655

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/shared/components/Contentful/Route.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ function ContentfulRoute(props) {
176176
const currentPathname = typeof location === 'undefined' ? '' : removeTrailingSlash(location.pathname);
177177
const redirectToUrl = _.trim(fields.redirectToUrl);
178178
const requireLogin = fields.protected;
179-
console.log('check route', requireLogin, auth, encodeURIComponent(url));
180-
if (requireLogin && (!auth || !auth.tokenV3)) {
179+
const loggedIn = isomorphy.isClientSide() && cookies.get('tcjwt') !== null;
180+
if (requireLogin && !loggedIn) {
181181
// route is protected by TC Login
182182
// send to login/register with proper retUrl set
183183
const authUrl = config.URL.AUTH;

0 commit comments

Comments
 (0)