Module | Picnic::Authentication |
In: |
lib/picnic/authentication.rb
|
These modules (currently only one module, but more in the future) provide authentication for your Camping app.
Enable authentication for your app.
For example:
Camping.goes :Blog Blog.picnic! $CONF[:authentication] ||= {:username => 'admin', :password => 'picnic'} Blog.authenticate_using :basic module Blog def self.authenticate(credentials) credentials[:username] == Taskr::Conf[:authentication][:username] && credentials[:password] == Taskr::Conf[:authentication][:password] end end
Note that in the above example we use the authentication configuration from your app‘s conf file.