Skip to content

Commit

Permalink
LG-1661 Fix copy on sign in selection list with backup codes (#3146)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevegsa authored Jul 30, 2019
1 parent bd2bb46 commit 56e4372
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module TwoFactorAuthentication
class BackupCodeSelectionPresenter < SelectionPresenter
def initialize(user)
@user = user
super(user&.backup_code_configurations&.first)
end

def method
Expand Down
6 changes: 6 additions & 0 deletions config/locales/two_factor_authentication/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ en:
login_options:
auth_app: Authentication app
auth_app_info_html: Use your authentication application to get security code.
backup_code: Backup codes
backup_code_info_html: Use a backup code from your list of backup codes to sign
in.
backup_code_only: Backup codes
backup_code_only_info_html: Use a backup code from your list of backup codes
to sign in.
personal_key: Personal Key
personal_key_info_html: Use the 16 character personal key you received at account
creation.
Expand Down
6 changes: 6 additions & 0 deletions config/locales/two_factor_authentication/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ es:
auth_app: Aplicación de autenticación
auth_app_info_html: Use su aplicación de autenticación para obtener el código
de seguridad.
backup_code: Códigos de respaldo
backup_code_info_html: Use un código de respaldo de su lista de códigos de respaldo
para iniciar sesión.
backup_code_only: Códigos de respaldo
backup_code_only_info_html: Use un código de respaldo de su lista de códigos
de respaldo para iniciar sesión.
personal_key: Clave personal
personal_key_info_html: Use la clave personal de 16 caracteres que usó en la
creación de la cuenta.
Expand Down
6 changes: 6 additions & 0 deletions config/locales/two_factor_authentication/fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ fr:
auth_app: Application d'authentification
auth_app_info_html: Utilisez votre application d'authentification pour obtenir
votre code de sécurité
backup_code: Codes de sauvegarde
backup_code_info_html: Utilisez un code de sauvegarde de votre liste de codes
de sauvegarde pour vous connecter.
backup_code_only: Codes de sauvegarde
backup_code_only_info_html: Utilisez un code de sauvegarde de votre liste de
codes de sauvegarde pour vous connecter.
personal_key: Clé personnelle
personal_key_info_html: Utilisez la clé personnelle de 16 caractères que vous
avez utilisée lors de la création du compte.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
it 'allows backup code only MFA configurations' do
user = sign_up_and_set_password
expect(FirstMfaEnabledForUser.call(user)).to eq(:error)
expect(page).to_not \
have_content t('two_factor_authentication.login_options.backup_code_info_html')
select_2fa_option('backup_code_only')

expect(page).to have_link(t('forms.backup_code.download'))
Expand Down Expand Up @@ -34,6 +36,9 @@
user = create(:user, :signed_up, :with_authentication_app, :with_backup_code)
BackupCodeGenerator::NUMBER_OF_CODES.times do |index|
signin(user.email, user.password)
visit login_two_factor_options_path
expect(page).to \
have_content t('two_factor_authentication.login_options.backup_code_info_html')
code = user.backup_code_configurations[index].code
visit login_two_factor_backup_code_path
fill_in :backup_code_verification_form_backup_code, with: code
Expand Down

0 comments on commit 56e4372

Please sign in to comment.