From 6df48c1413a14516e7ee8919f33fbc13f0141966 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Sat, 1 Aug 2026 02:39:59 +0200 Subject: Show and extend the elevation window A banner appears while elevated, counting down in minutes and carrying extend and drop controls. Three extensions of 30 minutes are allowed, so the window is at most two hours without a fresh code; a code resets the budget. The countdown is advisory, the server-side check authoritative, so it says "expired" rather than vanishing. The post-login flash tells an admin the timer has started. --- app/controllers/otp_challenges_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (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 87586241..2526d1fb 100644 --- a/app/controllers/otp_challenges_controller.rb +++ b/app/controllers/otp_challenges_controller.rb @@ -31,7 +31,12 @@ class OtpChallengesController < ApplicationController # an admin who logs in and goes straight to user management # is already elevated elevate! if user.is_admin? - flash[:notice] = t("flash.common.logged_in") + flash[:notice] = if user.is_admin? + t("flash.elevation.granted_at_login", + :minutes => AuthenticatedSystem::ELEVATION_MAX_AGE.in_minutes.to_i) + else + t("flash.common.logged_in") + end redirect_to safe_return_to(return_to, :default => admin_path) else flash.now[:error] = t("flash.otp.code_mismatch") -- cgit v1.3