about summary refs log tree commit diff
path: root/app/controllers/auth
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2017-06-25 16:54:30 +0200
committerGitHub <noreply@github.com>2017-06-25 16:54:30 +0200
commitf7301bd5b94d3033b5dbb9ff65dd1ed8ac825ce5 (patch)
treeddc52c8b89c84ee825d451cc50a6946d7d77b2bb /app/controllers/auth
parent099a3b4eaccc37338eda9f45fc26991ea7115200 (diff)
Add overview of active sessions (#3929)
* Add overview of active sessions

* Better display of browser/platform name

* Improve how browser information is stored and displayed for sessions overview

* Fix test
Diffstat (limited to 'app/controllers/auth')
-rw-r--r--app/controllers/auth/registrations_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/auth/registrations_controller.rb b/app/controllers/auth/registrations_controller.rb
index d385c08e1..60ace04d7 100644
--- a/app/controllers/auth/registrations_controller.rb
+++ b/app/controllers/auth/registrations_controller.rb
@@ -5,6 +5,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController
 
   before_action :check_enabled_registrations, only: [:new, :create]
   before_action :configure_sign_up_params, only: [:create]
+  before_action :set_sessions, only: [:edit, :update]
 
   def destroy
     not_found
@@ -41,4 +42,8 @@ class Auth::RegistrationsController < Devise::RegistrationsController
   def determine_layout
     %w(edit update).include?(action_name) ? 'admin' : 'auth'
   end
+
+  def set_sessions
+    @sessions = current_user.session_activations
+  end
 end