Module: Sinatra::SimpleAuth
- Defined in:
- lib/sinatra/simple_auth.rb
Defined Under Namespace
Modules: Helpers
Class Method Summary collapse
Class Method Details
.registered(app) ⇒ Object
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/sinatra/simple_auth.rb', line 44 def self.registered(app) app.helpers SimpleAuth::Helpers app.set :username, 'username' app.set :password, 'password' app.set :home, '/' app.set :context, '/' app.post "#{app.context}login/?" do auth!(params[:password],params[:username]) end app.delete "#{app.context}logout/?" do logout! end app.get "#{app.context}logout/?" do logout! end end |