Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/assets/javascripts/i18n-strings.js.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
window.LoginGov = window.LoginGov || {};

<% keys = [
'devise.two_factor_authentication.otp_delivery_preference.instruction',
'devise.two_factor_authentication.otp_delivery_preference.phone_unsupported',
'two_factor_authentication.otp_delivery_preference.instruction',
'two_factor_authentication.otp_delivery_preference.phone_unsupported',
'errors.messages.format_mismatch',
'errors.messages.missing_field',
'forms.passwords.show',
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/account_reset/cancel_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def create

def handle_success
sign_out if current_user
flash[:success] = t('devise.two_factor_authentication.account_reset.successful_cancel')
flash[:success] = t('two_factor_authentication.account_reset.successful_cancel')
end
end
end
2 changes: 1 addition & 1 deletion app/controllers/account_reset/report_fraud_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def update
def handle_success
analytics.track_event(Analytics::ACCOUNT_RESET, event: :fraud, token_valid: true)
sign_out if current_user
flash[:success] = t('devise.two_factor_authentication.account_reset.successful_cancel')
flash[:success] = t('two_factor_authentication.account_reset.successful_cancel')
end

def handle_failure
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/concerns/two_factor_authenticatable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ def two_factor_authentication_method

# Method will be renamed in the next refactor.
# You can pass in any "type" with a corresponding I18n key in
# devise.two_factor_authentication.invalid_#{type}
# two_factor_authentication.invalid_#{type}
def handle_invalid_otp(type: 'otp')
update_invalid_user

flash.now[:error] = t("devise.two_factor_authentication.invalid_#{type}")
flash.now[:error] = t("two_factor_authentication.invalid_#{type}")

if decorated_user.locked_out?
handle_second_factor_locked_user(type)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/otp_verification_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def handle_otp_confirmation_failure
if decorated_user.locked_out?
handle_too_many_otp_attempts
else
flash.now[:error] = t('devise.two_factor_authentication.invalid_otp')
flash.now[:error] = t('two_factor_authentication.invalid_otp')
render :show
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def confirm_voice_capability
return unless capabilities.sms_only?

flash[:error] = t(
'devise.two_factor_authentication.otp_delivery_preference.phone_unsupported',
'two_factor_authentication.otp_delivery_preference.phone_unsupported',
location: capabilities.unsupported_location
)
redirect_to login_two_factor_url(otp_delivery_preference: 'sms', reauthn: reauthn?)
Expand Down
4 changes: 2 additions & 2 deletions app/javascript/app/phone-internationalization.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const selectedInternationCodeOption = () => {
const unsupportedInternationalPhoneOTPDeliveryWarningMessage = () => {
const selectedOption = selectedInternationCodeOption();
if (selectedOption.dataset.smsOnly === 'true') {
const messageTemplate = I18n.t('devise.two_factor_authentication.otp_delivery_preference.phone_unsupported');
const messageTemplate = I18n.t('two_factor_authentication.otp_delivery_preference.phone_unsupported');
return messageTemplate.replace('%{location}', selectedOption.dataset.countryName);
}
return null;
Expand All @@ -27,7 +27,7 @@ const disablePhoneState = (phoneRadio, phoneLabel, smsRadio, deliveryMethodHint,
const enablePhoneState = (phoneRadio, phoneLabel, deliveryMethodHint) => {
phoneRadio.disabled = false;
phoneLabel.classList.remove('btn-disabled');
deliveryMethodHint.innerText = I18n.t('devise.two_factor_authentication.otp_delivery_preference.instruction');
deliveryMethodHint.innerText = I18n.t('two_factor_authentication.otp_delivery_preference.instruction');
};

const updateOTPDeliveryMethods = () => {
Expand Down
4 changes: 2 additions & 2 deletions app/presenters/account_recovery_options_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def options
AVAILABLE_2FA_TYPES.map do |type|
OpenStruct.new(
type: type,
label: t("devise.two_factor_authentication.two_factor_choice_options.#{type}"),
info: t("devise.two_factor_authentication.two_factor_choice_options.#{type}_info"),
label: t("two_factor_authentication.two_factor_choice_options.#{type}"),
info: t("two_factor_authentication.two_factor_choice_options.#{type}_info"),
selected: type == :sms
)
end
Expand Down
4 changes: 2 additions & 2 deletions app/presenters/phone_setup_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ def heading
end

def label
t("devise.two_factor_authentication.phone_#{otp_delivery_preference}_label")
t("two_factor_authentication.phone_#{otp_delivery_preference}_label")
end

def info
t("devise.two_factor_authentication.phone_#{otp_delivery_preference}_info_html")
t("two_factor_authentication.phone_#{otp_delivery_preference}_info_html")
end

def image
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module TwoFactorAuthCode
class AuthenticatorDeliveryPresenter < TwoFactorAuthCode::GenericDeliveryPresenter
def header
t('devise.two_factor_authentication.totp_header_text')
t('two_factor_authentication.totp_header_text')
end

def help_text
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def piv_cac_link
return unless FeatureManagement.piv_cac_enabled?
return unless has_piv_cac_configured
view.link_to(
t('devise.two_factor_authentication.piv_cac_fallback.link'),
t('two_factor_authentication.piv_cac_fallback.link'),
login_two_factor_piv_cac_path(locale: LinkLocaleResolver.locale)
)
end
Expand All @@ -55,7 +55,7 @@ def piv_cac_option
return unless FeatureManagement.piv_cac_enabled?
return unless has_piv_cac_configured
t(
'devise.two_factor_authentication.piv_cac_fallback.text_html',
'two_factor_authentication.piv_cac_fallback.text_html',
link: piv_cac_link
)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class MaxAttemptsReachedPresenter < FailurePresenter

COUNTDOWN_ID = 'countdown'.freeze

T_SCOPE = 'devise.two_factor_authentication'.freeze
T_SCOPE = 'two_factor_authentication'.freeze

def initialize(type, decorated_user)
super(:locked)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class PhoneDeliveryPresenter < TwoFactorAuthCode::GenericDeliveryPresenter
)

def header
t('devise.two_factor_authentication.header_text')
t('two_factor_authentication.header_text')
end

def phone_number_message
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class PivCacAuthenticationPresenter < TwoFactorAuthCode::GenericDeliveryPresente
include ActionView::Helpers::TranslationHelper

def header
t('devise.two_factor_authentication.piv_cac_header_text')
t('two_factor_authentication.piv_cac_header_text')
end

def help_text
Expand Down
8 changes: 4 additions & 4 deletions app/presenters/two_factor_login_options_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ def account_reset_or_cancel_link
private

def account_reset_link
t('devise.two_factor_authentication.account_reset.text_html',
t('two_factor_authentication.account_reset.text_html',
link: @view.link_to(
t('devise.two_factor_authentication.account_reset.link'),
t('two_factor_authentication.account_reset.link'),
account_reset_request_path(locale: LinkLocaleResolver.locale)
))
end

def account_reset_cancel_link
t('devise.two_factor_authentication.account_reset.pending_html',
t('two_factor_authentication.account_reset.pending_html',
cancel_link: @view.link_to(
t('devise.two_factor_authentication.account_reset.cancel_link'),
t('two_factor_authentication.account_reset.cancel_link'),
account_reset_cancel_url(token: account_reset_token)
))
end
Expand Down
8 changes: 4 additions & 4 deletions app/presenters/two_factor_options_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ def title
end

def heading
t('devise.two_factor_authentication.two_factor_choice')
t('two_factor_authentication.two_factor_choice')
end

def info
t('devise.two_factor_authentication.two_factor_choice_intro')
t('two_factor_authentication.two_factor_choice_intro')
end

def label
Expand All @@ -28,8 +28,8 @@ def options
available_2fa_types.map do |type|
OpenStruct.new(
type: type,
label: t("devise.two_factor_authentication.two_factor_choice_options.#{type}"),
info: t("devise.two_factor_authentication.two_factor_choice_options.#{type}_info"),
label: t("two_factor_authentication.two_factor_choice_options.#{type}"),
info: t("two_factor_authentication.two_factor_choice_options.#{type}_info"),
selected: type == :sms
)
end
Expand Down
2 changes: 1 addition & 1 deletion app/validators/otp_delivery_preference_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def otp_delivery_preference_supported
errors.add(
:phone,
I18n.t(
'devise.two_factor_authentication.otp_delivery_preference.phone_unsupported',
'two_factor_authentication.otp_delivery_preference.phone_unsupported',
location: phone_number_capabilities.unsupported_location
)
)
Expand Down
8 changes: 4 additions & 4 deletions app/views/idv/otp_delivery_method/new.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ p.mt1 = t('idv.messages.otp_delivery_method.phone_number_html',
class: :otp_delivery_preference_sms
span.indicator.mt-tiny
span.blue.bold.fs-20p
= t('devise.two_factor_authentication.otp_delivery_preference.sms')
= t('two_factor_authentication.otp_delivery_preference.sms')
.regular.gray-dark.fs-10p.mb-tiny
= t('devise.two_factor_authentication.two_factor_choice_options.sms_info')
= t('two_factor_authentication.two_factor_choice_options.sms_info')
label.btn-border.col-12.mb0
.radio
= radio_button_tag 'otp_delivery_selection_form[otp_delivery_preference]',
:voice, false,
class: :otp_delivery_preference_voice
span.indicator.mt-tiny
span.blue.bold.fs-20p
= t('devise.two_factor_authentication.otp_delivery_preference.voice')
= t('two_factor_authentication.otp_delivery_preference.voice')
.regular.gray-dark.fs-10p.mb-tiny
= t('devise.two_factor_authentication.two_factor_choice_options.voice_info')
= t('two_factor_authentication.two_factor_choice_options.voice_info')
- if FeatureManagement.enable_usps_verification?
.mt3
= t('idv.form.no_alternate_phone_html',
Expand Down
2 changes: 1 addition & 1 deletion app/views/idv/otp_verification/show.html.slim
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- title t('titles.enter_2fa_code')

h1.h3.my0 = t('devise.two_factor_authentication.header_text')
h1.h3.my0 = t('two_factor_authentication.header_text')

p == @presenter.phone_number_message

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- title t('titles.enter_2fa_code')

h1.h3.my0 = t('devise.two_factor_authentication.personal_key_header_text')
p.mt-tiny.mb0 = t('devise.two_factor_authentication.personal_key_prompt')
h1.h3.my0 = t('two_factor_authentication.personal_key_header_text')
p.mt-tiny.mb0 = t('two_factor_authentication.personal_key_prompt')

= simple_form_for(@personal_key_form, url: login_two_factor_personal_key_path,
html: { autocomplete: 'off', method: :post, role: 'form' }) do |f|
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
- title t('titles.present_webauthn')

h1.h3.my0 = t('devise.two_factor_authentication.webauthn_header_text')
h1.h3.my0 = t('two_factor_authentication.webauthn_header_text')
.no-spinner
p.mt-tiny.mb3 = t('instructions.mfa.webauthn.confirm_webauthn_html')

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
.mb3
fieldset.m0.p0.border-none
legend.mb1.h4.serif.bold = t('devise.two_factor_authentication.otp_delivery_preference.title')
legend.mb1.h4.serif.bold = t('two_factor_authentication.otp_delivery_preference.title')
p#otp_delivery_preference_instruction.mt0.mb2
= t('devise.two_factor_authentication.otp_delivery_preference.instruction')
= t('two_factor_authentication.otp_delivery_preference.instruction')
label.btn-border.col-12.sm-col-5.sm-mr2.mb2.sm-mb0
.radio
= radio_button_tag 'user_phone_form[otp_delivery_preference]', :sms, true,
class: :otp_delivery_preference_sms
span.indicator
= t('devise.two_factor_authentication.otp_delivery_preference.sms')
= t('two_factor_authentication.otp_delivery_preference.sms')
label.btn-border.col-12.sm-col-5.mb0
.radio
= radio_button_tag 'user_phone_form[otp_delivery_preference]', :voice, false,
class: :otp_delivery_preference_voice
span.indicator
= t('devise.two_factor_authentication.otp_delivery_preference.voice')
= t('two_factor_authentication.otp_delivery_preference.voice')
p.mb0.mt1
= link_to t('links.two_factor_authentication.app_option'), authenticator_setup_path
30 changes: 15 additions & 15 deletions config/i18n-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,21 +96,21 @@ ignore_unused:
- 'devise.mailer.confirmation_instructions.subject'
- 'devise.mailer.reset_password_instructions.subject'
- 'devise.sessions.signed_in'
- 'devise.two_factor_authentication.invalid_otp'
- 'devise.two_factor_authentication.invalid_personal_key'
- 'devise.two_factor_authentication.invalid_piv_cac'
- 'devise.two_factor_authentication.max_generic_login_attempts_reached'
- 'devise.two_factor_authentication.max_otp_login_attempts_reached'
- 'devise.two_factor_authentication.max_otp_requests_reached'
- 'devise.two_factor_authentication.max_personal_key_login_attempts_reached'
- 'devise.two_factor_authentication.max_piv_cac_login_attempts_reached'
- 'devise.two_factor_authentication.phone_sms_info_html'
- 'devise.two_factor_authentication.phone_sms_label'
- 'devise.two_factor_authentication.phone_voice_info_html'
- 'devise.two_factor_authentication.phone_voice_label'
- 'devise.two_factor_authentication.please_try_again_html'
- 'devise.two_factor_authentication.read_about_two_factor_authentication.link'
- 'devise.two_factor_authentication.read_about_two_factor_authentication.text_html'
- 'two_factor_authentication.invalid_otp'
- 'two_factor_authentication.invalid_personal_key'
- 'two_factor_authentication.invalid_piv_cac'
- 'two_factor_authentication.max_generic_login_attempts_reached'
- 'two_factor_authentication.max_otp_login_attempts_reached'
- 'two_factor_authentication.max_otp_requests_reached'
- 'two_factor_authentication.max_personal_key_login_attempts_reached'
- 'two_factor_authentication.max_piv_cac_login_attempts_reached'
- 'two_factor_authentication.phone_sms_info_html'
- 'two_factor_authentication.phone_sms_label'
- 'two_factor_authentication.phone_voice_info_html'
- 'two_factor_authentication.phone_voice_label'
- 'two_factor_authentication.please_try_again_html'
- 'two_factor_authentication.read_about_two_factor_authentication.link'
- 'two_factor_authentication.read_about_two_factor_authentication.text_html'
- 'errors.messages.*'
- 'forms.piv_cac_setup.*'
- 'headings.piv_cac_setup.*'
Expand Down
70 changes: 0 additions & 70 deletions config/locales/devise/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,73 +69,3 @@ en:
sessions:
signed_in: ''
signed_out: You are now signed out.
two_factor_authentication:
account_reset:
cancel_link: Cancel your request
link: deleting your account
pending_html: You currently have a pending request to delete your account.
It takes 24 hours from the time you made the request to complete the process.
Please check back later. %{cancel_link}
successful_cancel: Thank you. Your request to delete your login.gov account
has been cancelled.
text_html: If you can't use any of these security options above, you can reset
your preferences by %{link}.
header_text: Enter your security code
invalid_otp: That security code is invalid. You can try entering it again or
request a new one-time security code.
invalid_personal_key: That personal key is invalid.
invalid_piv_cac: That PIV/CAC is incorrect.
max_generic_login_attempts_reached: For your security, your account is temporarily
locked.
max_otp_login_attempts_reached: For your security, your account is temporarily
locked because you have entered the one-time security code incorrectly too
many times.
max_otp_requests_reached: For your security, your account is temporarily locked
because you have requested a security code too many times.
max_personal_key_login_attempts_reached: For your security, your account is
temporarily locked because you have entered the personal key incorrectly too
many times.
max_piv_cac_login_attempts_reached: For your security, your account is temporarily
locked because you have presented your piv/cac credential incorrectly too
many times.
otp_delivery_preference:
instruction: You can change this selection the next time you log in. If you
entered a landline, please select "Phone call" below.
phone_unsupported: We're unable to make phone calls to people in %{location}
at this time.
sms: Text message (SMS)
title: How should we send you a code?
voice: Phone call
personal_key_header_text: Enter your personal key
personal_key_prompt: You can use this personal key once. After you enter it,
you'll be provided a new key.
phone_sms_info_html: We'll text a security code <strong>each time you sign in</strong>.
phone_sms_label: Mobile phone number
phone_voice_info_html: We'll call you with a security code <strong>each time
you sign in</strong>.
phone_voice_label: Phone number
piv_cac_fallback:
link: Use your PIV/CAC instead
text_html: Do you have your PIV/CAC? %{link}
piv_cac_header_text: Present your PIV/CAC
please_try_again_html: Please try again in <strong id=%{id}>%{time_remaining}</strong>.
read_about_two_factor_authentication:
link: read about two-factor authentication
text_html: You can %{link} and why we use it at our Help page.
totp_header_text: Enter your authentication app code
two_factor_choice: Secure your account
two_factor_choice_intro: login.gov makes sure you can access your account by
adding a second layer of security.
two_factor_choice_options:
auth_app: Authentication application
auth_app_info: Set up an authentication application to get your security code
without providing a phone number
piv_cac: Government employees
piv_cac_info: Use your PIV/CAC card to secure your account
sms: Text message / SMS
sms_info: Get your security code via text message / SMS
voice: Phone call
voice_info: Get your security code via phone call
webauthn: Hardware security key
webauthn_info: Use a hardware security key to secure your account
webauthn_header_text: Present your hardware security key
Loading