Skip to content

Commit 187fa6f

Browse files
committed
debug auth
1 parent 2bae812 commit 187fa6f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/shared/components/Contentful/Route.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,12 @@ 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))
179180
if (requireLogin && (!auth || !auth.tokenV3)) {
180181
// route is protected by TC Login
181182
// send to login/register with proper retUrl set
182183
const authUrl = config.URL.AUTH;
183-
return <RedirectWithStatus status={401} from={url} to={`${authUrl}?retUrl=${encodeURIComponent(url)}`} />;
184+
return <RedirectWithStatus status={401} from={url} to={`${authUrl}?retUrl=${encodeURIComponent(config.URL.BASE + url)}`} />;
184185
}
185186
return redirectToUrl && currentPathname === url ? (
186187
<RedirectWithStatus status={301} from={url} to={redirectToUrl} />

0 commit comments

Comments
 (0)