Module: Sinatra::Auth::Gmail

Defined in:
lib/sinatra/auth/gmail.rb,
lib/sinatra_auth_gmail.rb

Defined Under Namespace

Modules: Helpers Classes: BadAuthentication, ExampleApp

Class Method Summary collapse

Class Method Details

.registered(app) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/sinatra/auth/gmail.rb', line 48

def self.registered(app)
  app.use Warden::Manager do |manager|
    manager.default_strategies :google_apps
    manager.failure_app = BadAuthentication

    manager[:google_apps_endpoint] = 'http://www.google.com/accounts/o8/id'
  end

  app.helpers Helpers

  app.get '/logout' do
    logout!
    haml "%h2= 'Peace!'"
  end
end