From baace1fa5df46694ddd515dc3bbca59b22df8692 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 25 Jul 2026 03:51:44 +0200 Subject: Extract flashes to i18n and stop dispatching on submit labels --- app/controllers/otp_challenges_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app/controllers/otp_challenges_controller.rb') diff --git a/app/controllers/otp_challenges_controller.rb b/app/controllers/otp_challenges_controller.rb index e31c36ca..eeaeac20 100644 --- a/app/controllers/otp_challenges_controller.rb +++ b/app/controllers/otp_challenges_controller.rb @@ -19,7 +19,7 @@ class OtpChallengesController < ApplicationController session[:otp_attempts] = session[:otp_attempts].to_i + 1 if session[:otp_attempts] > MAX_ATTEMPTS clear_pending - flash[:error] = "Too many attempts -- log in again." + flash[:error] = t("flash.otp.too_many_attempts") return redirect_to login_path end @@ -28,10 +28,10 @@ class OtpChallengesController < ApplicationController reset_session self.current_user = user session[:logged_in_at] = Time.now.to_i - flash[:notice] = "Logged in successfully" + flash[:notice] = t("flash.common.logged_in") redirect_to safe_return_to(return_to, :default => admin_path) else - flash.now[:error] = "That code did not match." + flash.now[:error] = t("flash.otp.code_mismatch") render :new end end -- cgit v1.3