]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5659 Issues link parameters disappear when fail to log 97/head
authorJulien Lancelot <julien.lancelot@sonarsource.com>
Wed, 18 Feb 2015 12:17:59 +0000 (13:17 +0100)
committerJulien Lancelot <julien.lancelot@sonarsource.com>
Wed, 18 Feb 2015 14:44:30 +0000 (15:44 +0100)
server/sonar-web/src/main/webapp/WEB-INF/app/controllers/sessions_controller.rb
server/sonar-web/src/main/webapp/WEB-INF/app/views/sessions/login.html.erb

index 7a7600afa03e14a5f44e80c3ca23e26bb68ce14f..cb94561ab1e7cc5a93f51eccdd15ba2a709e88c1 100644 (file)
@@ -35,6 +35,7 @@ class SessionsController < ApplicationController
       end
       redirect_back_or_default(home_url)
     else
+      @return_to_anchor = params[:return_to_anchor]
       flash.now[:loginerror] = message('session.flash_notice.authentication_failed')
     end
   end
index 0382575d0e2f37efd20bfdfc2d0b419ba2355e79..527ba5e18dd5b648abfc41a9dedca4f6b2c80fa7 100644 (file)
@@ -3,7 +3,7 @@
                        <td align="center">
                                <div id="login_form">
                                        <form action="<%= url_for :controller => 'sessions', :action => 'login' -%>" method="post">
-            <input type="hidden" name="return_to_anchor" value="">
+            <input type="hidden" name="return_to_anchor" value="<%= @return_to_anchor %>">
                                                <h3><%= label_tag message('login') %></h3>
                                                <p>
                                                        <%= text_field_tag 'login', '', {:maxlength => 255, :disabled => false, :style => 'width:200px;'} %>
@@ -31,5 +31,7 @@
        </table>
   <script>
     $j('#login').focus();
-    $j('[name=return_to_anchor]').val(window.location.hash);
+    if (!$j('[name=return_to_anchor]').val()) {
+      $j('[name=return_to_anchor]').val(window.location.hash);
+    }
   </script>