mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 07:25:44 +01:00
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:
@@ -72,10 +72,10 @@ class ErrorBoundary extends React.Component<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
redirectToLogin = (error: Error) => {
|
redirectToLogin = (error: Error) => {
|
||||||
const { loginLink } = this.props;
|
const { loginLink, location } = this.props;
|
||||||
if (error instanceof MissingLinkError) {
|
if (error instanceof MissingLinkError) {
|
||||||
if (loginLink) {
|
if (loginLink) {
|
||||||
window.location.assign(withContextPath("/login"));
|
window.location.assign(withContextPath("/login?from=" + location.pathname));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user