Skip to content

Commit

Permalink
Allow unauthenticated users in staging for 26-4555 (#16180)
Browse files Browse the repository at this point in the history
* Allow unauthenticated users in staging for 26-4555

* fix tests by requiring icn in test env
  • Loading branch information
Thrillberg authored Apr 3, 2024
1 parent 543a428 commit 77f43d6
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def submit

if form_is210966 && icn && first_party?
handle_210966_authenticated
elsif params[:form_number] == '26-4555' && icn
elsif form_is264555_and_should_use_lgy_api
parsed_form_data = JSON.parse(params.to_json)
form = SimpleFormsApi::VBA264555.new(parsed_form_data)
response = LGY::Service.new.post_grant_application(payload: form.as_payload)
Expand Down Expand Up @@ -233,6 +233,15 @@ def form_is210966
params[:form_number] == '21-0966'
end

def form_is264555_and_should_use_lgy_api
# TODO: Remove prod/test check and ALWAYS require icn
if Rails.env.production? || Rails.env.test?
params[:form_number] == '26-4555' && icn
else
params[:form_number] == '26-4555'
end
end

def should_authenticate
true unless UNAUTHENTICATED_FORMS.include? params[:form_number]
end
Expand Down

0 comments on commit 77f43d6

Please sign in to comment.