Class: CASino::SessionDestroyerProcessor
- Defined in:
- app/processors/casino/session_destroyer_processor.rb
Overview
The SessionDestroyer processor is used to destroy a ticket-granting ticket.
This feature is not described in the CAS specification so it’s completly optional to implement this on the web application side. It is especially useful in combination with the SessionOverviewProcessor processor.
Instance Method Summary collapse
-
#process(params = nil, cookies = nil, user_agent = nil) ⇒ Object
This method will call ‘#ticket_not_found` or `#ticket_deleted` on the listener.
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 ‘#ticket_not_found` or `#ticket_deleted` on the listener.
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/processors/casino/session_destroyer_processor.rb', line 12 def process(params = nil, = nil, user_agent = nil) params ||= {} ||= {} ticket = CASino::TicketGrantingTicket.where(id: params[:id]).first owner_ticket = CASino::TicketGrantingTicket.where(ticket: [:tgt]).first if ticket.nil? || !ticket.same_user?(owner_ticket) @listener.ticket_not_found else Rails.logger.info "Destroying ticket-granting ticket '#{ticket.ticket}'" ticket.destroy @listener.ticket_deleted end end |