Class: Booth::Hooks::BeforeLogout

Inherits:
Object
  • Object
show all
Includes:
Logging, Calls
Defined in:
lib/booth/hooks/before_logout.rb

Instance Method Summary collapse

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/booth/hooks/before_logout.rb', line 13

def call
  return unless passport # Attempting to logout when already logged out.

  log { "Revoking Session #{passport.session_id} in scope #{scope.inspect} because of logout" }

  ::Booth::Models::Session.where(id: passport.session_id)
                          .update_all(revoked_at: Time.current, revoke_reason: :logout)

  nil
end