File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/shared/components/Contentful Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff 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 } />
You can’t perform that action at this time.
0 commit comments