From 4ab11882012f495cd97efb1a67e1f3912bbf6406 Mon Sep 17 00:00:00 2001 From: Jonathan Hutchison Date: Thu, 19 Feb 2026 16:42:15 -0500 Subject: [PATCH 1/6] Add headings, error messages for login.gov signin fail states --- .../components/page/utility/error_component.html.erb | 4 ++++ .../page/utility/error_component_preview.rb | 8 ++++++++ .../app/controllers/login_dot_gov_controller.rb | 11 ++++++----- dpc-portal/config/locales/en.yml | 4 ++++ 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/dpc-portal/app/components/page/utility/error_component.html.erb b/dpc-portal/app/components/page/utility/error_component.html.erb index 804019b95..3026d212f 100644 --- a/dpc-portal/app/components/page/utility/error_component.html.erb +++ b/dpc-portal/app/components/page/utility/error_component.html.erb @@ -32,5 +32,9 @@ <%= render Core::Button::ButtonComponent.new(label: "Sign out of Login.gov", destination: login_dot_gov_logout_path, method: :delete) %> + <% when :login_gov_signin_cancel %> + <%= link_to 'Back to portal home', root_path, class: 'usa-button usa-button--outline', data: { turbo: false }%> + <% when :login_gov_signin_fail %> + <%= link_to 'Back to portal home', root_path, class: 'usa-button usa-button--outline', data: { turbo: false }%> <% end %> diff --git a/dpc-portal/app/components/page/utility/error_component_preview.rb b/dpc-portal/app/components/page/utility/error_component_preview.rb index 75a6d63af..9b2472c2c 100644 --- a/dpc-portal/app/components/page/utility/error_component_preview.rb +++ b/dpc-portal/app/components/page/utility/error_component_preview.rb @@ -69,6 +69,14 @@ def no_account reason = 'no_account' render(Page::Utility::ErrorComponent.new(nil, reason)) end + def login_gov_signin_cancel + reason = 'login_gov_signin_cancel' + render(Page::Utility::ErrorComponent.new(nil, reason)) + end + def login_gov_signin_fail + reason = 'login_gov_signin_fail' + render(Page::Utility::ErrorComponent.new(nil, reason)) + end end end end diff --git a/dpc-portal/app/controllers/login_dot_gov_controller.rb b/dpc-portal/app/controllers/login_dot_gov_controller.rb index 56a88d20c..e0f088e67 100644 --- a/dpc-portal/app/controllers/login_dot_gov_controller.rb +++ b/dpc-portal/app/controllers/login_dot_gov_controller.rb @@ -29,13 +29,14 @@ def failure if invitation_flow_match handle_invitation_flow_failure(invitation_flow_match[2]) elsif params[:code] - @message = 'Something went wrong.' logger.error 'Login.gov Configuration error' + render(Page::Utility::ErrorComponent.new(nil, 'login_gov_signin_fail')) else - @message = 'You have decided not to authenticate via login.gov.' - Rails.logger.info(['User cancelled login', - { actionContext: LoggingConstants::ActionContext::Authentication, - actionType: LoggingConstants::ActionType::UserCancelledLogin }]) + # @message = 'You have decided not to authenticate via login.gov.' + Rails.logger.info(['User cancelled login', + { actionContext: LoggingConstants::ActionContext::Authentication, + actionType: LoggingConstants::ActionType::UserCancelledLogin }]) + render(Page::Utility::ErrorComponent.new(nil, 'login_gov_signin_cancel')) end end diff --git a/dpc-portal/config/locales/en.yml b/dpc-portal/config/locales/en.yml index 01a4d7a6b..76fba1757 100644 --- a/dpc-portal/config/locales/en.yml +++ b/dpc-portal/config/locales/en.yml @@ -45,6 +45,10 @@ en: configuration_complete: Setup complete api_disabled: API disabled access_denied: Access denied + login_gov_signin_cancel_status: Login.gov sign-in incomplete + login_gov_signin_cancel_text: Login.gov sign-in was unsuccessful. If this was an error, try signing in again. + login_gov_signin_fail_status: Login.gov sign-in failed + login_gov_signin_fail_text: Something went wrong while trying to sign-in with Login.gov. Please try again. cd_access: no_approved_enrollment_status: This organization is not currently approved by Medicare. no_approved_enrollment_text: This organization must have an approved enrollment status with Medicare to access beneficiary claims data. From 10e7bfb3d3fa662505ba86856d9ef57f7174c262 Mon Sep 17 00:00:00 2001 From: Jonathan Hutchison Date: Thu, 5 Mar 2026 15:12:17 -0500 Subject: [PATCH 2/6] Fix formatting --- .../components/page/utility/error_component_preview.rb | 2 ++ dpc-portal/app/controllers/login_dot_gov_controller.rb | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dpc-portal/app/components/page/utility/error_component_preview.rb b/dpc-portal/app/components/page/utility/error_component_preview.rb index 9b2472c2c..98b484568 100644 --- a/dpc-portal/app/components/page/utility/error_component_preview.rb +++ b/dpc-portal/app/components/page/utility/error_component_preview.rb @@ -69,10 +69,12 @@ def no_account reason = 'no_account' render(Page::Utility::ErrorComponent.new(nil, reason)) end + def login_gov_signin_cancel reason = 'login_gov_signin_cancel' render(Page::Utility::ErrorComponent.new(nil, reason)) end + def login_gov_signin_fail reason = 'login_gov_signin_fail' render(Page::Utility::ErrorComponent.new(nil, reason)) diff --git a/dpc-portal/app/controllers/login_dot_gov_controller.rb b/dpc-portal/app/controllers/login_dot_gov_controller.rb index e0f088e67..c7187592d 100644 --- a/dpc-portal/app/controllers/login_dot_gov_controller.rb +++ b/dpc-portal/app/controllers/login_dot_gov_controller.rb @@ -32,11 +32,11 @@ def failure logger.error 'Login.gov Configuration error' render(Page::Utility::ErrorComponent.new(nil, 'login_gov_signin_fail')) else - # @message = 'You have decided not to authenticate via login.gov.' - Rails.logger.info(['User cancelled login', - { actionContext: LoggingConstants::ActionContext::Authentication, - actionType: LoggingConstants::ActionType::UserCancelledLogin }]) - render(Page::Utility::ErrorComponent.new(nil, 'login_gov_signin_cancel')) + # @message = 'You have decided not to authenticate via login.gov.' + Rails.logger.info(['User cancelled login', + { actionContext: LoggingConstants::ActionContext::Authentication, + actionType: LoggingConstants::ActionType::UserCancelledLogin }]) + render(Page::Utility::ErrorComponent.new(nil, 'login_gov_signin_cancel')) end end From c58e46d4f67ea22bbb81fe7b67bece0bef5d56ea Mon Sep 17 00:00:00 2001 From: Jonathan Hutchison Date: Fri, 6 Mar 2026 10:15:30 -0500 Subject: [PATCH 3/6] Remove comment --- dpc-portal/app/controllers/login_dot_gov_controller.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/dpc-portal/app/controllers/login_dot_gov_controller.rb b/dpc-portal/app/controllers/login_dot_gov_controller.rb index c7187592d..3a6c29ac3 100644 --- a/dpc-portal/app/controllers/login_dot_gov_controller.rb +++ b/dpc-portal/app/controllers/login_dot_gov_controller.rb @@ -32,7 +32,6 @@ def failure logger.error 'Login.gov Configuration error' render(Page::Utility::ErrorComponent.new(nil, 'login_gov_signin_fail')) else - # @message = 'You have decided not to authenticate via login.gov.' Rails.logger.info(['User cancelled login', { actionContext: LoggingConstants::ActionContext::Authentication, actionType: LoggingConstants::ActionType::UserCancelledLogin }]) From 4ca7922c1513d7d98097e026234a05ce3735d5eb Mon Sep 17 00:00:00 2001 From: Jonathan Hutchison Date: Fri, 6 Mar 2026 10:27:51 -0500 Subject: [PATCH 4/6] Update test --- dpc-portal/spec/system/accessibility_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpc-portal/spec/system/accessibility_spec.rb b/dpc-portal/spec/system/accessibility_spec.rb index 966bd33f7..35598feb7 100644 --- a/dpc-portal/spec/system/accessibility_spec.rb +++ b/dpc-portal/spec/system/accessibility_spec.rb @@ -19,7 +19,7 @@ end it 'shows login failure' do visit '/users/auth/failure' - expect(page).to have_text('Try again') + expect(page).to have_text('sign-in was unsuccessful') expect(page).to be_axe_clean.according_to axe_standard end From 484934ac023601b9b203182116fc1ec45989bfde Mon Sep 17 00:00:00 2001 From: jdettmannnava <145699825+jdettmannnava@users.noreply.github.com> Date: Fri, 6 Mar 2026 11:07:52 -0500 Subject: [PATCH 5/6] Apply suggestions from code review --- dpc-portal/app/components/page/utility/error_component.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpc-portal/app/components/page/utility/error_component.html.erb b/dpc-portal/app/components/page/utility/error_component.html.erb index 3026d212f..31690f527 100644 --- a/dpc-portal/app/components/page/utility/error_component.html.erb +++ b/dpc-portal/app/components/page/utility/error_component.html.erb @@ -35,6 +35,6 @@ <% when :login_gov_signin_cancel %> <%= link_to 'Back to portal home', root_path, class: 'usa-button usa-button--outline', data: { turbo: false }%> <% when :login_gov_signin_fail %> - <%= link_to 'Back to portal home', root_path, class: 'usa-button usa-button--outline', data: { turbo: false }%> + <%= link_to 'Back to portal home', new_user_session_path, class: 'usa-button usa-button--outline', data: { turbo: false }%> <% end %> From be24b383c253c33935b9012aded11fca8ae2c1e5 Mon Sep 17 00:00:00 2001 From: Jonathan Hutchison Date: Fri, 6 Mar 2026 11:31:20 -0500 Subject: [PATCH 6/6] Update dpc-portal/app/components/page/utility/error_component.html.erb Co-authored-by: jdettmannnava <145699825+jdettmannnava@users.noreply.github.com> --- dpc-portal/app/components/page/utility/error_component.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dpc-portal/app/components/page/utility/error_component.html.erb b/dpc-portal/app/components/page/utility/error_component.html.erb index 31690f527..7a3abc5ed 100644 --- a/dpc-portal/app/components/page/utility/error_component.html.erb +++ b/dpc-portal/app/components/page/utility/error_component.html.erb @@ -33,7 +33,7 @@ destination: login_dot_gov_logout_path, method: :delete) %> <% when :login_gov_signin_cancel %> - <%= link_to 'Back to portal home', root_path, class: 'usa-button usa-button--outline', data: { turbo: false }%> + <%= link_to 'Back to portal home', new_user_session_path, class: 'usa-button usa-button--outline', data: { turbo: false }%> <% when :login_gov_signin_fail %> <%= link_to 'Back to portal home', new_user_session_path, class: 'usa-button usa-button--outline', data: { turbo: false }%> <% end %>