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.
This commit is contained in:
René Pfeuffer
2020-09-02 10:18:42 +02:00
parent 055081db9f
commit abedebda10

View File

@@ -72,10 +72,10 @@ class ErrorBoundary extends React.Component<Props, State> {
}
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));
}
}
};