Commit 05b82686 authored by Stan Hu's avatar Stan Hu

Merge branch 'fix-frontend-feature-flags-failed-sign-in' into 'master'

Switch from respond_with_navigational to redirect_to

See merge request gitlab-org/gitlab!85127
parents 6063a6e9 9af9f3c3
......@@ -126,7 +126,7 @@ class SessionsController < Devise::SessionsController
flash[:alert] = _('There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.')
flash.delete :recaptcha_error
respond_with_navigational(resource) { render :new }
redirect_to new_user_session_path
end
end
......
......@@ -123,7 +123,7 @@ module EE
flash[:alert] = 'Login failed. Please retry from your primary device and network.'
flash.delete :recaptcha_error
respond_with_navigational(resource) { render :new }
redirect_to new_user_session_path
end
def arkose_public_api_key
......
......@@ -172,7 +172,7 @@ RSpec.describe SessionsController, :geo do
end
post(:create, params: params, session: {})
expect(response).to render_template(:new)
expect(response).to redirect_to new_user_session_path
expect(flash[:alert]).to include 'Login failed. Please retry from your primary device and network'
expect(subject.current_user).to be_nil
end
......@@ -182,7 +182,7 @@ RSpec.describe SessionsController, :geo do
it 'prevents the user from logging in' do
post(:create, params: params.except!(:arkose_labs_token), session: {})
expect(response).to render_template(:new)
expect(response).to redirect_to new_user_session_path
expect(flash[:alert]).to include 'Login failed. Please retry from your primary device and network'
expect(subject.current_user).to be_nil
end
......
......@@ -238,7 +238,7 @@ RSpec.describe SessionsController do
unsuccesful_login(user_params)
expect(response).to render_template(:new)
expect(response).to redirect_to new_user_session_path
expect(flash[:alert]).to include _('There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.')
expect(subject.current_user).to be_nil
end
......@@ -262,7 +262,7 @@ RSpec.describe SessionsController do
it 'displays an error when the reCAPTCHA is not solved' do
unsuccesful_login(user_params, sesion_params: { failed_login_attempts: 6 })
expect(response).to render_template(:new)
expect(response).to redirect_to new_user_session_path
expect(flash[:alert]).to include _('There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.')
expect(subject.current_user).to be_nil
end
......@@ -282,7 +282,7 @@ RSpec.describe SessionsController do
it 'displays an error when the reCAPTCHA is not solved' do
unsuccesful_login(user_params)
expect(response).to render_template(:new)
expect(response).to redirect_to new_user_session_path
expect(flash[:alert]).to include _('There was an error with the reCAPTCHA. Please solve the reCAPTCHA again.')
expect(subject.current_user).to be_nil
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment