Skip to content

Commit 5b3d48c

Browse files
committed
fixup! fix: login redirect
1 parent 237d292 commit 5b3d48c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

site/src/pages/LoginPage/LoginPage.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ export const LoginPage: FC = () => {
4949
});
5050
}, [isSignedIn, buildInfoQuery.data, user?.id]);
5151

52+
// The reason we need `window.location.href` for api redirects is that we
53+
// need the page to reload and make a request to the backend. If we use
54+
// `<Navigate>` react would handle the redirect itself and never request the
55+
// page from the backend.
5256
if (isSignedIn && isApiRouteRedirect) {
5357
const sanitizedUrl = new URL(redirectTo, window.location.origin);
5458
window.location.href = sanitizedUrl.pathname + sanitizedUrl.search;

0 commit comments

Comments
 (0)