From 685d67cc3f9c1e68af5d66c6e792e38e567b3288 Mon Sep 17 00:00:00 2001 From: "Padilla, Gerald" Date: Sat, 28 Jan 2017 20:22:13 -0600 Subject: [PATCH] Remove flash warning from login page --- app/controllers/root_controller.rb | 3 ++- .../25360-remove-flash-warning-from-login-page.yml | 4 ++++ spec/features/login_spec.rb | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/25360-remove-flash-warning-from-login-page.yml diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb index 627be74a38f..db2817fadf6 100644 --- a/app/controllers/root_controller.rb +++ b/app/controllers/root_controller.rb @@ -7,6 +7,7 @@ # For users who haven't customized the setting, we simply delegate to # `DashboardController#show`, which is the default. class RootController < Dashboard::ProjectsController + skip_before_action :authenticate_user!, only: [:index] before_action :redirect_to_custom_dashboard, only: [:index] def index @@ -16,7 +17,7 @@ class RootController < Dashboard::ProjectsController private def redirect_to_custom_dashboard - return unless current_user + return redirect_to new_user_session_path unless current_user case current_user.dashboard when 'stars' diff --git a/changelogs/unreleased/25360-remove-flash-warning-from-login-page.yml b/changelogs/unreleased/25360-remove-flash-warning-from-login-page.yml new file mode 100644 index 00000000000..50a5c879446 --- /dev/null +++ b/changelogs/unreleased/25360-remove-flash-warning-from-login-page.yml @@ -0,0 +1,4 @@ +--- +title: Remove flash warning from login page +merge_request: 8864 +author: Gerald J. Padilla diff --git a/spec/features/login_spec.rb b/spec/features/login_spec.rb index 76bcfbe523a..ab7d89306db 100644 --- a/spec/features/login_spec.rb +++ b/spec/features/login_spec.rb @@ -25,6 +25,11 @@ feature 'Login', feature: true do expect(current_path).to eq root_path end + + it 'does not show flash messages when login page' do + visit root_path + expect(page).not_to have_content('You need to sign in or sign up before continuing.') + end end describe 'with two-factor authentication' do