Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f3a6d6 commit fa957d6Copy full SHA for fa957d6
site/src/components/RequireAuth/RequireAuth.tsx
@@ -13,10 +13,9 @@ export const RequireAuth: React.FC<RequireAuthProps> = ({ children }) => {
13
const xServices = useContext(XServiceContext)
14
const [authState] = useActor(xServices.authXService)
15
const location = useLocation()
16
- const redirectTo = embedRedirect(location.pathname)
17
-
+ const navigateTo = location.pathname === "/" ? "/login" : embedRedirect(location.pathname)
18
if (authState.matches("signedOut")) {
19
- return <Navigate to={redirectTo} />
+ return <Navigate to={navigateTo} />
20
} else if (authState.hasTag("loading")) {
21
return <FullScreenLoader />
22
} else {
0 commit comments