diff --git a/app/controllers/public/account_controller.rb b/app/controllers/public/account_controller.rb index 9ecc4ce..3fc00b0 100644 --- a/app/controllers/public/account_controller.rb +++ b/app/controllers/public/account_controller.rb @@ -397,7 +397,20 @@ class AccountController < ApplicationController end else if environment == current_user.environment - redirect_back_or_default(user.admin_url) + case environment.redirection_after_login + when 'keep_on_same_page' + redirect_back_or_default(user.admin_url) + when 'site_homepage' + redirect_to :controller => :home + when 'user_profile_page' + redirect_to user.public_profile_url + when 'user_homepage' + redirect_to user.url + when 'user_control_panel' + redirect_to user.admin_url + else + redirect_back_or_default(user.admin_url) + end else redirect_back_or_default(:controller => 'home') end diff --git a/features/signup.feature b/features/signup.feature index 59ea024..a58f417 100644 --- a/features/signup.feature +++ b/features/signup.feature @@ -111,7 +111,7 @@ Feature: signup @selenium Scenario: user should go to his profile page after signup - Given the environment is configured to redirect to profile page after signup + Given the environment is configured to redirect to user profile page after signup And feature "skip_new_user_email_confirmation" is enabled on environment And I am on /search/people When I follow "Sign up" @@ -145,7 +145,6 @@ Feature: signup Scenario: user should stay on same page after following confirmation link Given the environment is configured to stay on the same page after login And feature "skip_new_user_email_confirmation" is disabled on environment - And feature "allow_change_of_redirection_after_login" is enabled on environment And I am on /search/people When I follow "Sign up" And I fill in the following within ".no-boxes": @@ -166,7 +165,6 @@ Feature: signup Scenario: user should go to his homepage after following confirmation link Given the environment is configured to redirect to profile homepage after login And feature "skip_new_user_email_confirmation" is disabled on environment - And feature "allow_change_of_redirection_after_login" is enabled on environment And I am on /search/people When I follow "Sign up" And I fill in the following within ".no-boxes": @@ -187,7 +185,6 @@ Feature: signup Scenario: user should go to his control panel after following confirmation link Given the environment is configured to redirect to profile control panel after login And feature "skip_new_user_email_confirmation" is disabled on environment - And feature "allow_change_of_redirection_after_login" is enabled on environment And I am on /search/people When I follow "Sign up" And I fill in the following within ".no-boxes": @@ -206,9 +203,8 @@ Feature: signup @selenium Scenario: user should go to his profile page after following confirmation link - Given the environment is configured to redirect to profile page after login + Given the environment is configured to redirect to user profile page after login And feature "skip_new_user_email_confirmation" is disabled on environment - And feature "allow_change_of_redirection_after_login" is enabled on environment And I am on /search/people When I follow "Sign up" And I fill in the following within ".no-boxes": @@ -229,7 +225,6 @@ Feature: signup Scenario: user should go to the environment homepage after following confirmation link Given the environment is configured to redirect to site homepage after login And feature "skip_new_user_email_confirmation" is disabled on environment - And feature "allow_change_of_redirection_after_login" is enabled on environment And I am on /search/people When I follow "Sign up" And I fill in the following within ".no-boxes": -- libgit2 0.21.2