diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-25 03:51:44 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-25 03:51:44 +0200 |
| commit | baace1fa5df46694ddd515dc3bbca59b22df8692 (patch) | |
| tree | 6a8b587ca5d6d38377fe132b02c857f1c4149231 /app/controllers/otp_challenges_controller.rb | |
| parent | ed32bc6902ab634451539770bcd910662212e01a (diff) | |
Extract flashes to i18n and stop dispatching on submit labels
Diffstat (limited to 'app/controllers/otp_challenges_controller.rb')
| -rw-r--r-- | app/controllers/otp_challenges_controller.rb | 6 |
1 files changed, 3 insertions, 3 deletions
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 | |||
| 19 | session[:otp_attempts] = session[:otp_attempts].to_i + 1 | 19 | session[:otp_attempts] = session[:otp_attempts].to_i + 1 |
| 20 | if session[:otp_attempts] > MAX_ATTEMPTS | 20 | if session[:otp_attempts] > MAX_ATTEMPTS |
| 21 | clear_pending | 21 | clear_pending |
| 22 | flash[:error] = "Too many attempts -- log in again." | 22 | flash[:error] = t("flash.otp.too_many_attempts") |
| 23 | return redirect_to login_path | 23 | return redirect_to login_path |
| 24 | end | 24 | end |
| 25 | 25 | ||
| @@ -28,10 +28,10 @@ class OtpChallengesController < ApplicationController | |||
| 28 | reset_session | 28 | reset_session |
| 29 | self.current_user = user | 29 | self.current_user = user |
| 30 | session[:logged_in_at] = Time.now.to_i | 30 | session[:logged_in_at] = Time.now.to_i |
| 31 | flash[:notice] = "Logged in successfully" | 31 | flash[:notice] = t("flash.common.logged_in") |
| 32 | redirect_to safe_return_to(return_to, :default => admin_path) | 32 | redirect_to safe_return_to(return_to, :default => admin_path) |
| 33 | else | 33 | else |
| 34 | flash.now[:error] = "That code did not match." | 34 | flash.now[:error] = t("flash.otp.code_mismatch") |
| 35 | render :new | 35 | render :new |
| 36 | end | 36 | end |
| 37 | end | 37 | end |
