Class: Sso::Warden::Hooks::SessionCheck

Inherits:
Object
  • Object
show all
Includes:
Support
Defined in:
lib/sso/warden/hooks/session_check.rb

Instance Method Summary collapse

Methods included from Support

#initialize, #logged_in?, #scope, #session

Methods included from Logging

#debug, #error, #fatal, #info, #warn

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
# File 'lib/sso/warden/hooks/session_check.rb', line 7

def call
  debug { "Starting hook after user is fetched into the session" }

  unless logged_in? && Sso::Session.find_by_id(session["sso_session_id"]).try(:active?)
    warden.logout(scope)
    throw(:warden, :scope => scope, :reason => "Sso::Session INACTIVE")
  end
end