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) {
176
176
const currentPathname = typeof location === 'undefined' ? '' : removeTrailingSlash ( location . pathname ) ;
177
177
const redirectToUrl = _ . trim ( fields . redirectToUrl ) ;
178
178
const requireLogin = fields . protected ;
179
+ console . log ( 'check route' , requireLogin , auth , encodeURIComponent ( url ) )
179
180
if ( requireLogin && ( ! auth || ! auth . tokenV3 ) ) {
180
181
// route is protected by TC Login
181
182
// send to login/register with proper retUrl set
182
183
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 ) } ` } /> ;
184
185
}
185
186
return redirectToUrl && currentPathname === url ? (
186
187
< RedirectWithStatus status = { 301 } from = { url } to = { redirectToUrl } />
You can’t perform that action at this time.
0 commit comments