Merge pull request #5136 from thornbill/login-redirect

Add support for redirecting to the requested page after login
This commit is contained in:
Bill Thornton
2024-02-07 00:56:40 -05:00
committed by GitHub
2 changed files with 24 additions and 13 deletions
+3 -2
View File
@@ -47,8 +47,9 @@ const ConnectionRequired: FunctionComponent<ConnectionRequiredProps> = ({
if (location.pathname === BounceRoutes.Login) {
setIsLoading(false);
} else {
console.debug('[ConnectionRequired] not logged in, redirecting to login page');
navigate(`${BounceRoutes.Login}?serverid=${connectionResponse.ApiClient.serverId()}`);
console.debug('[ConnectionRequired] not logged in, redirecting to login page', location);
const url = encodeURIComponent(location.pathname + location.search);
navigate(`${BounceRoutes.Login}?serverid=${connectionResponse.ApiClient.serverId()}&url=${url}`);
}
return;
case ConnectionState.ServerSelection: