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
|
||||
|
||||
def redirect_to_login_if_fc_aborted
|
||||
if params[:code].empty?
|
||||
if params[:code].blank?
|
||||
redirect_to new_user_session_path
|
||||
end
|
||||
end
|
||||
|
|
|
@ -25,6 +25,12 @@ describe FranceConnect::ParticulierController, type: :controller do
|
|||
|
||||
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
|
||||
let(:code) { nil }
|
||||
|
||||
|
|
Loading…
Reference in a new issue