summaryrefslogtreecommitdiff
path: root/app/controllers/sessions_controller.rb
diff options
context:
space:
mode:
authorazul <azul@leap.se>2015-10-19 11:15:17 +0200
committerazul <azul@leap.se>2015-10-19 11:15:17 +0200
commitc2cc1a48a4faeff4088cdf5f56e6b0382acfb346 (patch)
tree33b41304f30166182af2ff989b20d43efd75f183 /app/controllers/sessions_controller.rb
parentfd55d71cd1cbadcc5378601c0c9dfa6292bd4725 (diff)
parent02c1e607bf8beb1f576307a7ad87f0cdbe3381c0 (diff)
Merge pull request #196 from EvyW/develop
Admin - Ability to enable/disable user
Diffstat (limited to 'app/controllers/sessions_controller.rb')
-rw-r--r--app/controllers/sessions_controller.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index 66eba40..34d4f53 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -32,4 +32,13 @@ class SessionsController < ApplicationController
# throw :warden, response.finish
#end
+ Warden::Manager.after_set_user do |user, auth, opts|
+ scope = opts[:scope]
+ unless user.enabled?
+ auth.logout(scope)
+ throw(:warden, scope: scope, reason: "User not active")
+ end
+ end
+
+
end