Class: CASino::OtherSessionsDestroyerProcessor
- Includes:
- ProcessorConcern::TicketGrantingTickets
- Defined in:
- app/processors/casino/other_sessions_destroyer_processor.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_destroyed` and may supply an URL that should be presented to the user.
Methods included from ProcessorConcern::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 ProcessorConcern::Browser
Methods inherited from Processor
Constructor Details
This class inherits a constructor from CASino::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.
16 17 18 19 20 21 22 23 24 25 |
# File 'app/processors/casino/other_sessions_destroyer_processor.rb', line 16 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 |