class Rodauth::Configuration
def enable(*features)
def enable(*features) features.each do |feature| next if @auth.features.include?(feature) load_feature(feature) @auth.features << feature end end
def initialize(auth, &block)
def initialize(auth, &block) @auth = auth load_feature(:base) instance_exec(&block) auth.allocate.post_configure end
def load_feature(feature_name)
def load_feature(feature_name) require "rodauth/features/#{feature_name}" feature = FEATURES[feature_name] enable(*feature.dependencies) extend feature.configuration @auth.routes.concat(feature.routes) @auth.send(:include, feature) end