Sha256: b6cb541c4a37892723496b7627132ee4484dc41ff88aa2115ef03f86b74b2c7f
Contents?: true
Size: 786 Bytes
Versions: 13
Compression:
Stored size: 786 Bytes
Contents
# frozen_string_literal: true module Occams::AccessControl module AdminAuthentication # Set username and password in config/initializers/occams.rb # Like this: # Occams::AccessControl::AdminAuthentication.username = 'myname' # Occams::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
13 entries across 13 versions & 1 rubygems