Class: Carpool::Responder

Inherits:
Object
  • Object
show all
Defined in:
lib/carpool/responder.rb

Class Method Summary collapse

Class Method Details

.authenticateObject



5
6
7
# File 'lib/carpool/responder.rb', line 5

def self.authenticate
  [307, {"Location" => Carpool::Driver.unauthorized_uri}, "Redirecing for authentication."]
end

.passenger_redirect(passenger, payload) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/carpool/responder.rb', line 9

def self.passenger_redirect(passenger, payload)
  new_uri  = "#{passenger.scheme}://"
  new_uri << passenger.host
  new_uri << ((passenger.port != 80 && passenger.port != 443) ? ":#{passenger.port}" : "")
  new_uri << "/sso/authorize?seatbelt=#{payload}"
  [303, {"Location" => new_uri}, "Redirecting...."]
end