diff --git a/app/javascript/packs/webauthn-authenticate.ts b/app/javascript/packs/webauthn-authenticate.ts
index f98180d9677..fc8e7c35ed5 100644
--- a/app/javascript/packs/webauthn-authenticate.ts
+++ b/app/javascript/packs/webauthn-authenticate.ts
@@ -3,9 +3,6 @@ import type { VerifyCredentialDescriptor } from '@18f/identity-webauthn';
function webauthn() {
const webauthnInProgressContainer = document.getElementById('webauthn-auth-in-progress')!;
- const webauthnSuccessContainer = document.getElementById('webauthn-auth-successful')!;
-
- const webauthAlertContainer = document.querySelector('.usa-alert--error')!;
const spinner = document.getElementById('spinner')!;
spinner.classList.remove('display-none');
@@ -30,22 +27,19 @@ function webauthn() {
(document.getElementById('client_data_json') as HTMLInputElement).value =
result.clientDataJSON;
(document.getElementById('signature') as HTMLInputElement).value = result.signature;
- webauthnInProgressContainer.classList.add('display-none');
- webauthnSuccessContainer.classList.remove('display-none');
- // Check if alert container is shown and remove when device passes successfully.
- if (webauthAlertContainer) {
- webauthAlertContainer.remove();
- }
})
.catch((error: Error) => {
(document.getElementById('webauthn_error') as HTMLInputElement).value = error.name;
+ })
+ .then(() => {
(document.getElementById('webauthn_form') as HTMLFormElement).submit();
});
}
}
function webauthnButton() {
- const button = document.getElementById('webauthn-button')!;
+ const button = document.getElementById('webauthn-button') as HTMLButtonElement;
+ button.type = 'button';
button.addEventListener('click', webauthn);
}
diff --git a/app/presenters/two_factor_auth_code/webauthn_authentication_presenter.rb b/app/presenters/two_factor_auth_code/webauthn_authentication_presenter.rb
index 7fd4dfc6969..619bd3020ac 100644
--- a/app/presenters/two_factor_auth_code/webauthn_authentication_presenter.rb
+++ b/app/presenters/two_factor_auth_code/webauthn_authentication_presenter.rb
@@ -37,26 +37,10 @@ def authenticate_button_text
end
end
- def login_text
- if platform_authenticator?
- t('forms.webauthn_platform_setup.login_text')
- else
- t('forms.webauthn_setup.login_text')
- end
- end
-
def help_text
''
end
- def verified_info_text
- if platform_authenticator?
- t('two_factor_authentication.webauthn_platform_verified.info')
- else
- t('two_factor_authentication.webauthn_verified.info')
- end
- end
-
def header
if platform_authenticator?
t('two_factor_authentication.webauthn_platform_header_text')
@@ -65,14 +49,6 @@ def header
end
end
- def verified_header
- if platform_authenticator?
- t('two_factor_authentication.webauthn_platform_verified.header')
- else
- t('two_factor_authentication.webauthn_verified.header')
- end
- end
-
def link_text
if service_provider_mfa_policy.phishing_resistant_required?
if service_provider_mfa_policy.allow_user_to_switch_method?
@@ -113,15 +89,6 @@ def webauthn_not_enabled_link
end
end
- def fallback_question
- return '' unless service_provider_mfa_policy.allow_user_to_switch_method?
- if platform_authenticator?
- t('two_factor_authentication.webauthn_platform_fallback.question')
- else
- t('two_factor_authentication.webauthn_fallback.question')
- end
- end
-
def multiple_factors_enabled?
service_provider_mfa_policy.multiple_factors_enabled?
end
diff --git a/app/views/two_factor_authentication/webauthn_verification/show.html.erb b/app/views/two_factor_authentication/webauthn_verification/show.html.erb
index c12ff6faee0..c710f0d4b99 100644
--- a/app/views/two_factor_authentication/webauthn_verification/show.html.erb
+++ b/app/views/two_factor_authentication/webauthn_verification/show.html.erb
@@ -31,7 +31,7 @@
webauthn_not_enabled_url: @presenter.webauthn_not_enabled_link,
},
) do %>
-
+
<%= image_tag(
asset_url('spinner.gif'),
srcset: asset_url('spinner@2x.gif'),
@@ -39,43 +39,41 @@
width: 144,
alt: '',
) %>
+
+ <%= t('two_factor_authentication.webauthn_authenticating') %>
+
-
- <%= @presenter.login_text %>
-
-