From abedebda10ac07cc5acbc38de0a8daf560d1202e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Pfeuffer?= Date: Wed, 2 Sep 2020 10:18:42 +0200 Subject: [PATCH] Fix redirect to requested location in anonymous mode If anonymous mode is enabled, the user should be redirected to the requested location after login, when he entered a restricted URL. Therefore we have to append the requested location to the login link here. --- scm-ui/ui-components/src/ErrorBoundary.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scm-ui/ui-components/src/ErrorBoundary.tsx b/scm-ui/ui-components/src/ErrorBoundary.tsx index 33c8a48494..3d0144b95b 100644 --- a/scm-ui/ui-components/src/ErrorBoundary.tsx +++ b/scm-ui/ui-components/src/ErrorBoundary.tsx @@ -72,10 +72,10 @@ class ErrorBoundary extends React.Component { } redirectToLogin = (error: Error) => { - const { loginLink } = this.props; + const { loginLink, location } = this.props; if (error instanceof MissingLinkError) { if (loginLink) { - window.location.assign(withContextPath("/login")); + window.location.assign(withContextPath("/login?from=" + location.pathname)); } } };