Skip to content

Commit 5b9dc2e

Browse files
fix(site): add search params to auth redirect (coder#9005)
1 parent 53f26b3 commit 5b9dc2e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

site/src/components/RequireAuth/RequireAuth.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ export const RequireAuth: FC = () => {
1010
const [authState] = useAuth()
1111
const location = useLocation()
1212
const isHomePage = location.pathname === "/"
13-
const navigateTo = isHomePage ? "/login" : embedRedirect(location.pathname)
13+
const navigateTo = isHomePage
14+
? "/login"
15+
: embedRedirect(`${location.pathname}${location.search}`)
1416

1517
if (authState.matches("signedOut")) {
1618
return <Navigate to={navigateTo} state={{ isRedirect: !isHomePage }} />

0 commit comments

Comments
 (0)