Sha256: 05dc9334c39051dab01a1c32fe40e082fbc55f48232280f4874d85c0ad3c22cb

Contents?: true

Size: 705 Bytes

Versions: 35

Compression:

Stored size: 705 Bytes

Contents

module ComfortableMexicanSofa::HttpAuth
  # Set username and password in config/initializers/comfortable_mexican_sofa.rb
  # Like this:
  #   ComfortableMexicanSofa::HttpAuth.username = 'myname'
  #   ComfortableMexicanSofa::HttpAuth.password = 'mypassword'
  mattr_accessor  :username,
                  :password
  
  # Simple http_auth. When implementing some other form of authentication
  # this method should return +true+ if everything is great, or redirect user
  # to some other page, thus denying access to cms admin section.
  def authenticate
    authenticate_or_request_with_http_basic do |username, password|
      username == self.username && password == self.password
    end
  end
  
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.6.31 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.11.0 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.10.3 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.10.2 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.10.1 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.10.0 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.9.3 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.9.2 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.8.5 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.9.1 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.9.0 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.8.4 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.8.3 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.8.2 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.8.1 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.8.0 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.6.30 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.7.3 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.7.1 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.7.0 lib/comfortable_mexican_sofa/authentication/http_auth.rb