OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Remove internal login flag after login action
Oliver Güntherf3cfae7a01ba
diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rbindex 3fe1143f991..af4ef4f5161 100644--- a/app/controllers/account_controller.rb+++ b/app/controllers/account_controller.rb@@ -41,6 +41,7 @@ class AccountController < ApplicationControllerbefore_action :disable_apibefore_action :check_auth_source_sso_failure, only: :auth_source_sso_failedbefore_action :check_internal_login_enabled, only: :internal_login+ after_action :remove_internal_login_flag, only: :loginlayout 'no_menu'@@ -537,4 +538,8 @@ class AccountController < ApplicationControllerdef check_internal_login_enabledrender_404 unless omniauth_direct_login?end++ def remove_internal_login_flag+ session.delete :internal_login+ endenddiff --git a/spec/controllers/account_controller_spec.rb b/spec/controllers/account_controller_spec.rbindex 6b436990512..52a4b280642 100644--- a/spec/controllers/account_controller_spec.rb+++ b/spec/controllers/account_controller_spec.rb@@ -112,6 +112,7 @@ describe AccountController,get :loginexpect(response).to render_template 'login'+ expect(session).not_to have_key :internal_loginendend@@ -119,7 +120,7 @@ describe AccountController,it 'allows to login internally using a special route' doget :internal_login- expect(response.status).to eq 404+ expect(response).to have_http_status(404)expect(session[:internal_login]).not_to be_presentendend@@ -831,9 +832,7 @@ describe AccountController,endit 'preserves the back url' do- expect(response).to redirect_to(- '/login?back_url=https%3A%2F%2Fexample.net%2Fsome_back_url'- )+ expect(response).to redirect_to('/login?back_url=https%3A%2F%2Fexample.net%2Fsome_back_url')endit 'calls the user_registered callback' do