Sha256: 540f25de6a960ed4334ef75bb6283116bc01550cdbf409ad28a8fcf517643165

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

if (initializers = Castronaut.config.initializers) && !initializers.empty?
  initializers.each { |i| load i }
end

def presents(klass, template_type=Castronaut.config.template_type)
  @page_title ||= 'Sign In'
  @presenter = klass.new(self)
  @presenter.represent!
  mission = @presenter.your_mission
  if mission[:redirect]
    redirect mission[:redirect], mission[:status]
  elsif mission[:template]
    send template_type, mission[:template], :layout => mission[:layout].nil? ? :layout : mission[:layout]
  end
end

get '/' do
  redirect '/login'
end

get '/login' do
  no_cache
  presents Castronaut::Presenters::Login
end

post '/login' do
  presents Castronaut::Presenters::ProcessLogin
end

get '/logout' do
  presents Castronaut::Presenters::Logout
end

get '/serviceValidate' do
  presents Castronaut::Presenters::ServiceValidate, :erb
end

get '/proxyValidate' do
  presents Castronaut::Presenters::ProxyValidate, :erb
end

private
  def no_cache
    headers 'Pragma' => 'no-cache',
    'Cache-Control' => 'no-store',
    'Expires' => (Time.now - 5.years).rfc2822
  end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
3mix-castronaut-0.5.0.2 app/controllers/application.rb