Sha256: ac7a3677a8bca7697451b61a1a498e327c24da9204ec4de2829b33d07c1bf035

Contents?: true

Size: 682 Bytes

Versions: 50

Compression:

Stored size: 682 Bytes

Contents

module ComfortableMexicanSofa::HttpAuth
  # Set username and password in config/initializers/comfortable_mexican_sofa.rb
  # Like this:
  #   CmsHttpAuthentication.username = 'myname'
  #   CmsHttpAuthentication.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

50 entries across 50 versions & 1 rubygems

Version Path
comfortable_mexican_sofa-1.5.8 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.5.7 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.5.6 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.5.5 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.5.4 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.5.3 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.5.2 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.5.1 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.5.0 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.4.22 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.4.21 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.4.20 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.4.19 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.4.18 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.4.17 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.4.16 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.4.15 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.4.14 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.4.13 lib/comfortable_mexican_sofa/authentication/http_auth.rb
comfortable_mexican_sofa-1.4.12 lib/comfortable_mexican_sofa/authentication/http_auth.rb