diff options
author | Evelyn <evy_mcr@outlook.com> | 2015-09-20 13:53:53 -0500 |
---|---|---|
committer | Evelyn <evy_mcr@outlook.com> | 2015-09-20 13:53:53 -0500 |
commit | 9c350b60e87a58e4fcf748fe3c9bc1baa5c04655 (patch) | |
tree | c4fd007e20381daa16ce57ee4f4fcdc8fb8dca2e /app/controllers/sessions_controller.rb | |
parent | 3e8771097ab7392560fdf07a85c011c23098fd1e (diff) |
adding ability to disable/enable users by admin
Diffstat (limited to 'app/controllers/sessions_controller.rb')
-rw-r--r-- | app/controllers/sessions_controller.rb | 9 |
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 |