Commit a18bae9e4b9db49b6d0378f0ba6d9b77751444a7
1 parent
a269cf07
Exists in
master
and in
28 other branches
ActionItem445: redirect back if login fail
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2065 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
3 additions
and
1 deletions
Show diff stats
app/controllers/public/account_controller.rb
@@ -21,6 +21,7 @@ class AccountController < PublicController | @@ -21,6 +21,7 @@ class AccountController < PublicController | ||
21 | flash[:notice] = _("Logged in successfully") | 21 | flash[:notice] = _("Logged in successfully") |
22 | else | 22 | else |
23 | flash[:notice] = _('Incorrect username or password') | 23 | flash[:notice] = _('Incorrect username or password') |
24 | + redirect_to :back | ||
24 | end | 25 | end |
25 | end | 26 | end |
26 | 27 |
test/functional/account_controller_test.rb
@@ -39,9 +39,10 @@ class AccountControllerTest < Test::Unit::TestCase | @@ -39,9 +39,10 @@ class AccountControllerTest < Test::Unit::TestCase | ||
39 | end | 39 | end |
40 | 40 | ||
41 | def test_should_fail_login_and_not_redirect | 41 | def test_should_fail_login_and_not_redirect |
42 | + @request.env["HTTP_REFERER"] = 'bli' | ||
42 | post :login, :user => {:login => 'johndoe', :password => 'bad password'} | 43 | post :login, :user => {:login => 'johndoe', :password => 'bad password'} |
43 | assert_nil session[:user] | 44 | assert_nil session[:user] |
44 | - assert_response :success | 45 | + assert_response :redirect |
45 | end | 46 | end |
46 | 47 | ||
47 | def test_should_allow_signup | 48 | def test_should_allow_signup |