Skip to content

Commit

Permalink
fix: #2765 route path now goes to login (#2766)
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcvay authored Sep 29, 2020
1 parent 8f6ce66 commit c48ce16
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
9 changes: 4 additions & 5 deletions packages/developer-portal/src/core/private-route-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,18 @@ export const PrivateRouteWrapper: React.FunctionComponent<PrivateRouteWrapperPro
children,
showMenu = true,
}) => {
if (window.location.pathname === '/') {
return <Redirect to={Routes.LOGIN} />
}

const { connectSession, connectInternalRedirect } = useReapitConnect(reapitConnectBrowserSession)
const location = useLocation()
const currentUri = `${location.pathname}${location.search}`
const isRoot = connectInternalRedirect === '/?' || connectInternalRedirect === '/' || window.location.pathname === '/'

if (!connectSession) {
return null
}

if (isRoot) {
return <Redirect to={Routes.APPS} />
}

if (connectInternalRedirect && currentUri !== connectInternalRedirect) {
return <Redirect to={connectInternalRedirect} />
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c48ce16

Please sign in to comment.