]> source.dussan.org Git - sonarqube.git/commitdiff
fix redirection after login
authorStas Vilchik <vilchiks@gmail.com>
Tue, 28 Feb 2017 09:15:50 +0000 (10:15 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 28 Feb 2017 09:15:50 +0000 (10:15 +0100)
server/sonar-web/src/main/js/apps/sessions/components/LoginFormContainer.js

index 69554d224e585480425bd957eeda9d57f0ada117..90237122ec52b2f4a6a11bcb19f60d12387b09ac 100644 (file)
@@ -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) => {