fix: omit url params on login (#1666)

resolves #1282
This commit is contained in:
Kira Pilot
2022-05-23 11:01:32 -04:00
committed by GitHub
parent 9f3a6d631c
commit fa957d6d65
@@ -13,10 +13,9 @@ export const RequireAuth: React.FC<RequireAuthProps> = ({ children }) => {
const xServices = useContext(XServiceContext)
const [authState] = useActor(xServices.authXService)
const location = useLocation()
const redirectTo = embedRedirect(location.pathname)
const navigateTo = location.pathname === "/" ? "/login" : embedRedirect(location.pathname)
if (authState.matches("signedOut")) {
return <Navigate to={redirectTo} />
return <Navigate to={navigateTo} />
} else if (authState.hasTag("loading")) {
return <FullScreenLoader />
} else {