aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.js b/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.js
index 69554d224e5..90237122ec5 100644
--- a/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.js
+++ b/server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.js
@@ -48,7 +48,10 @@ class LoginFormContainer extends React.Component {
}
handleSuccessfulLogin = () => {
- window.location = this.props.location.query['return_to'] || (window.baseUrl + '/');
+ const { location } = this.props;
+ const queryReturnTo = location.query['return_to'];
+ const returnTo = queryReturnTo ? `${queryReturnTo}${location.hash}` : `${window.baseUrl}/`;
+ window.location = returnTo;
};
handleSubmit = (login: string, password: string) => {