diff --git a/app/controllers/user/sessions_controller.rb b/app/controllers/user/sessions_controller.rb index 361c6fb3..8829e017 100644 --- a/app/controllers/user/sessions_controller.rb +++ b/app/controllers/user/sessions_controller.rb @@ -21,7 +21,7 @@ class User::SessionsController < Devise::SessionsController if params[:user][:otp_attempt].length == 8 found = TotpRecoveryCode.where(user_id: resource.id, code: params[:user][:otp_attempt].downcase).delete_all if found == 1 - flash[:info] = "You have #{TotpRecoveryCode.where(user_id: resource.id).count} recovery codes remaining." + flash[:info] = t(".info", count: TotpRecoveryCode.where(user_id: resource.id).count) continue_sign_in(resource, resource_name) else flash[:error] = t(".error") diff --git a/config/locales/controllers.en.yml b/config/locales/controllers.en.yml index f466a568..53c7ece0 100644 --- a/config/locales/controllers.en.yml +++ b/config/locales/controllers.en.yml @@ -45,4 +45,5 @@ en: error: "Theme saving failed. %{errors}" sessions: create: + info: "You have %{count} recovery codes remaining." error: :errors.invalid_otp