module Saml::Rails::ControllerHelper

Public Class Methods

included(base) click to toggle source
# File lib/saml/rails/controller_helper.rb, line 4
def self.included(base)
  base.extend self
  base.before_action :set_response_headers
end

Public Instance Methods

current_provider(entity_id_or_method = nil, &block) click to toggle source
# File lib/saml/rails/controller_helper.rb, line 9
def current_provider(entity_id_or_method = nil, &block)
  if block_given?
    before_action &block
  else
    case entity_id_or_method
      when Symbol
        before_action { Saml.current_provider = send(entity_id_or_method) }
      else
        before_action { Saml.current_provider = Saml.provider("#{entity_id_or_method}") }
    end
  end
end
current_store(store) click to toggle source
# File lib/saml/rails/controller_helper.rb, line 22
def current_store(store)
  before_action { Saml.current_store = store }
end
set_response_headers() click to toggle source
# File lib/saml/rails/controller_helper.rb, line 26
def set_response_headers
  response.headers['Cache-Control'] = 'no-cache, no-store'
  response.headers['Pragma']        = 'no-cache'
end