Sha256: 9e359009294ff761c12e722ca150f4a1a219f580f1761a7aa30d1ea3e7331b6a

Contents?: true

Size: 701 Bytes

Versions: 15

Compression:

Stored size: 701 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

15 entries across 15 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.6.11 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.6.10 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.6.9 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.6.8 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.6.7 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.6.6 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.6.5 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.6.4 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.6.3 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.6.2 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.6.1 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.6.0 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.5.11 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.5.10 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.5.9 lib/comfortable_mexican_sofa/authentication/http_auth.rb