Class: CASinoCore::Processor::OtherSessionsDestroyer
- Inherits:
-
CASinoCore::Processor
- Object
- CASinoCore::Processor
- CASinoCore::Processor::OtherSessionsDestroyer
- Includes:
- Helper::TicketGrantingTickets
- Defined in:
- lib/casino_core/processor/other_sessions_destroyer.rb
Overview
The OtherSessionsDestroyer processor should be used to process GET requests to /destroy-other-sessions.
It is usefule to redirect users to this action after a password change.
This feature is not described in the CAS specification so it's completly optional to implement this on the web application side.
Instance Method Summary collapse
-
#process(params = nil, cookies = nil, user_agent = nil) ⇒ Object
This method will call
#other_sessions_destroyedand may supply an URL that should be presented to the user.
Methods included from Helper::TicketGrantingTickets
#acquire_ticket_granting_ticket, #cleanup_expired_ticket_granting_tickets, #find_valid_ticket_granting_ticket, #load_or_initialize_user, #remove_ticket_granting_ticket
Methods included from Helper::Logger
Methods included from Helper::Browser
Methods inherited from CASinoCore::Processor
Constructor Details
This class inherits a constructor from CASinoCore::Processor
Instance Method Details
#process(params = nil, cookies = nil, user_agent = nil) ⇒ Object
This method will call #other_sessions_destroyed and may supply an URL that should be presented to the user.
The user should be redirected to this URL immediately.
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/casino_core/processor/other_sessions_destroyer.rb', line 20 def process(params = nil, = nil, user_agent = nil) params ||= {} ||= {} tgt = find_valid_ticket_granting_ticket([:tgt], user_agent) unless tgt.nil? other_ticket_granting_tickets = tgt.user.ticket_granting_tickets.where('id != ?', tgt.id) other_ticket_granting_tickets.destroy_all end @listener.other_sessions_destroyed(params[:service]) end |