Class: CASino::LogoutProcessor

Inherits:
Processor show all
Includes:
ProcessorConcern::TicketGrantingTickets
Defined in:
app/processors/casino/logout_processor.rb

Overview

The Logout processor should be used to process GET requests to /logout.

Instance Method Summary collapse

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

#browser_info, #same_browser?

Methods inherited from Processor

#initialize

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 ‘#user_logged_out` and may supply an URL that should be presented to the user. As per specification, the URL specified by “url” SHOULD be on the logout page with descriptive text. For example, “The application you just logged out of has provided a link it would like you to follow. Please click here to access www.go-back.edu/.”

Parameters:

  • params (Hash) (defaults to: nil)

    parameters supplied by user

  • cookies (Hash) (defaults to: nil)

    cookies supplied by user

  • user_agent (String) (defaults to: nil)

    user-agent delivered by the client



13
14
15
16
17
18
19
20
21
22
# File 'app/processors/casino/logout_processor.rb', line 13

def process(params = nil, cookies = nil, user_agent = nil)
  params ||= {}
  cookies ||= {}
  remove_ticket_granting_ticket(cookies[:tgt], user_agent)
  if params[:service] && CASino::ServiceRule.allowed?(params[:service])
    @listener.user_logged_out(params[:service], true)
  else
    @listener.user_logged_out(params[:url])
  end
end