diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-08-02 23:55:38 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-08-02 23:55:38 +0200 |
| commit | c63c4620d1c659712cec93e354e84f5017bd6254 (patch) | |
| tree | cb4b71768aab6d3b41c97f221ddbf06a148d8481 /app/controllers/otp_challenges_controller.rb | |
| parent | 665bad61a26fd98b581c1f60981da94c05a28ca0 (diff) | |
Log user logins and reconstruct last activity from logs
Diffstat (limited to 'app/controllers/otp_challenges_controller.rb')
| -rw-r--r-- | app/controllers/otp_challenges_controller.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/controllers/otp_challenges_controller.rb b/app/controllers/otp_challenges_controller.rb index 2526d1fb..5a834ed0 100644 --- a/app/controllers/otp_challenges_controller.rb +++ b/app/controllers/otp_challenges_controller.rb | |||
| @@ -28,6 +28,8 @@ 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 | user.update_column(:last_login_at, Time.now) | ||
| 32 | |||
| 31 | # an admin who logs in and goes straight to user management | 33 | # an admin who logs in and goes straight to user management |
| 32 | # is already elevated | 34 | # is already elevated |
| 33 | elevate! if user.is_admin? | 35 | elevate! if user.is_admin? |
