diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 1d619518..d5879bf5 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -70,7 +70,6 @@ def regenerate_key # Resets password of user specified in params[:email], and sends the new password to the user by e-mail. def reset - current_user_session.try :destroy if request.post? user = User.find_by_email(params[:email]) if user.nil? @@ -88,6 +87,7 @@ def reset else @page_title = _("Reset password") end + current_user_session.try :destroy end protected diff --git a/features/keep_user_logged_out_on_password_reset.feature b/features/keep_user_logged_out_on_password_reset.feature index 40417adb..8ca0d00d 100644 --- a/features/keep_user_logged_out_on_password_reset.feature +++ b/features/keep_user_logged_out_on_password_reset.feature @@ -9,6 +9,7 @@ Feature: Keep user logged out on password reset And I am on the password reset page When I fill in "email" with "" And I press "Reset password" + And I go to the event list Then I should not be logged in And I should not see ""