Sha256: cd6f6dbb6a50b63a4a9d3946e470a87c366c358114918888f09b262f6cfa6e5b
Contents?: true
Size: 854 Bytes
Versions: 17
Compression:
Stored size: 854 Bytes
Contents
# frozen_string_literal: true module ComfortableMexicanSofa::AccessControl module AdminAuthentication # Set username and password in config/initializers/comfortable_mexican_sofa.rb # Like this: # ComfortableMexicanSofa::AccessControl::AdminAuthentication.username = 'myname' # ComfortableMexicanSofa::AccessControl::AdminAuthentication.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| self.username == username && self.password == password end end end end
Version data entries
17 entries across 17 versions & 6 rubygems