france_connect: fix for params entirely missing from the callback
Fix a Sentry exception encountered in production.
This commit is contained in:
parent
d7828e9a1e
commit
f5f7dfba40
2 changed files with 7 additions and 1 deletions
|
@ -30,7 +30,7 @@ class FranceConnect::ParticulierController < ApplicationController
|
||||||
private
|
private
|
||||||
|
|
||||||
def redirect_to_login_if_fc_aborted
|
def redirect_to_login_if_fc_aborted
|
||||||
if params[:code].empty?
|
if params[:code].blank?
|
||||||
redirect_to new_user_session_path
|
redirect_to new_user_session_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,6 +25,12 @@ describe FranceConnect::ParticulierController, type: :controller do
|
||||||
|
|
||||||
subject { get :callback, params: { code: code } }
|
subject { get :callback, params: { code: code } }
|
||||||
|
|
||||||
|
context 'when params are missing' do
|
||||||
|
subject { get :callback }
|
||||||
|
|
||||||
|
it { is_expected.to redirect_to(new_user_session_path) }
|
||||||
|
end
|
||||||
|
|
||||||
context 'when param code is missing' do
|
context 'when param code is missing' do
|
||||||
let(:code) { nil }
|
let(:code) { nil }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue