[Git][noosfero/noosfero][master-1.x] 2 commits: Redirects to login when activating without token
Rodrigo Souto
gitlab at mg.gitlab.com
Thu Jun 21 17:44:32 BRT 2018
Rodrigo Souto pushed to branch master-1.x at Noosfero / noosfero
Commits:
cdb6ecf7 by Gabriel Silva at 2018-06-18T16:47:05Z
Redirects to login when activating without token
Signed-off-by: Gabriel Silva <gabriel93.silva at gmail.com>
- - - - -
72ac7e55 by Rodrigo Souto at 2018-06-21T20:44:28Z
Merge branch 'activate-redirection' into 'master-1.x'
Redirects to login when activation params are invalid
See merge request noosfero/noosfero!1541
- - - - -
2 changed files:
- app/controllers/public/account_controller.rb
- test/functional/account_controller_test.rb
Changes:
=====================================
app/controllers/public/account_controller.rb
=====================================
@@ -542,6 +542,6 @@ class AccountController < ApplicationController
end
def check_activation_token
- render_not_found unless params[:activation_token]
+ redirect_to action: :login unless params[:activation_token].present?
end
end
=====================================
test/functional/account_controller_test.rb
=====================================
@@ -719,9 +719,9 @@ class AccountControllerTest < ActionController::TestCase
assert_redirected_to action: :login
end
- should 'respond with 404 when activation token is not sent' do
+ should 'redirect to login when activation token is not sent' do
get :activate, activation_token: nil
- assert_response 404
+ assert_redirected_to action: :login
end
should 'activate user when activation code is present and correct' do
@@ -1109,7 +1109,7 @@ class AccountControllerTest < ActionController::TestCase
should 'render 404 if activation token is not sent when requesting new codes' do
get :resend_activation_codes
- assert_response 404
+ assert_redirected_to action: :login
end
should 'redirect to login if user was activated when requesting new codes' do
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/b55dac2f18c8c8f343e1661785e7c3baaab01d07...72ac7e550b15f526ff55e222b454b631f20790df
--
View it on GitLab: https://gitlab.com/noosfero/noosfero/compare/b55dac2f18c8c8f343e1661785e7c3baaab01d07...72ac7e550b15f526ff55e222b454b631f20790df
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20180621/888e6032/attachment-0001.html>
More information about the Noosfero-dev
mailing list