From 9350e00bb96410e1dca6245bf65a8dbf72817798 Mon Sep 17 00:00:00 2001 From: Caillou <6117264+JeSuisUnCaillou@users.noreply.github.com> Date: Mon, 18 Nov 2024 10:21:52 +0100 Subject: [PATCH] fake user token for staging (because FC credentials have changed for QF API, the test account doesn't work anymore) --- lib/api_particulier/quotient_familial/v2.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/api_particulier/quotient_familial/v2.rb b/lib/api_particulier/quotient_familial/v2.rb index ac673221..b0b1e94c 100644 --- a/lib/api_particulier/quotient_familial/v2.rb +++ b/lib/api_particulier/quotient_familial/v2.rb @@ -3,6 +3,7 @@ module QuotientFamilial class V2 < Base def initialize(access_token:, siret:) @access_token = access_token + fake_user_token_for_staging @siret = siret end @@ -21,6 +22,10 @@ def query_params def add_authentication_headers(request) request["Authorization"] = "Bearer #{@access_token}" end + + def fake_user_token_for_staging + @access_token = "cnaf_qfv2" unless Rails.env.production? + end end end end