Sha256: bd7ec0bf65113eeff18a674aceb148d3a20824a1a4c06bb97b62810c9727d902
Contents?: true
Size: 897 Bytes
Versions: 15
Compression:
Stored size: 897 Bytes
Contents
%w(./app/models sinatra/base sinatra/flash).each { |lib| require lib } require 'entrance/addons/omniauth' require 'omniauth-twitter' module Example class Routes < Sinatra::Base register Sinatra::Flash register Entrance::OmniAuth set :sessions, :secret => 'veryverysecretkey' set :views, File.expand_path(File.dirname(__FILE__)) + '/views' set :auth_test, true # only true for testing set :auth_remember, true # enables 'remember me' for omniauth logins set :auth_providers, { :twitter => { :key => 'foobar', :secret => 'xoxoxoxox' } } before do login_required :except => ['/login'] end get '/' do erb :welcome end get '/login' do erb :login end get '/logout' do logout! flash[:notice] = 'Logged out! See you soon.' redirect to('/login') end end end
Version data entries
15 entries across 15 versions & 1 rubygems