Merge pull request #3851 from betagouv/fix-fc-callback

Correction d'une erreur rare lors du login France Connect
This commit is contained in:
Pierre de La Morinerie 2019-05-13 15:56:57 +02:00 committed by GitHub
commit 97fcbe88a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -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

View file

@ -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 }