From 5b9dc2ee8b19bcc140e83b712265d46ca4b3d195 Mon Sep 17 00:00:00 2001 From: Bruno Quaresma Date: Wed, 9 Aug 2023 16:31:12 -0300 Subject: [PATCH] fix(site): add search params to auth redirect (#9005) --- site/src/components/RequireAuth/RequireAuth.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/site/src/components/RequireAuth/RequireAuth.tsx b/site/src/components/RequireAuth/RequireAuth.tsx index dd7bcddf25..c403160377 100644 --- a/site/src/components/RequireAuth/RequireAuth.tsx +++ b/site/src/components/RequireAuth/RequireAuth.tsx @@ -10,7 +10,9 @@ export const RequireAuth: FC = () => { const [authState] = useAuth() const location = useLocation() const isHomePage = location.pathname === "/" - const navigateTo = isHomePage ? "/login" : embedRedirect(location.pathname) + const navigateTo = isHomePage + ? "/login" + : embedRedirect(`${location.pathname}${location.search}`) if (authState.matches("signedOut")) { return