Module: Omniauth::Protect

Defined in:
lib/omniauth/protect.rb,
lib/omniauth/protect/version.rb,
lib/omniauth/protect/validator.rb,
lib/omniauth/protect/middleware.rb

Defined Under Namespace

Classes: ConfigException, Middleware, Validator

Constant Summary collapse

VERSION =
'3.0.1'

Class Method Summary collapse

Class Method Details

.configObject



16
17
18
# File 'lib/omniauth/protect.rb', line 16

def self.config
  @config
end

.configureObject

Adds / to the paths

Raises:



21
22
23
24
25
26
27
28
29
30
# File 'lib/omniauth/protect.rb', line 21

def self.configure
  raise ConfigException.new('message must be specified') if config[:message].empty?
  raise ConfigException.new('paths must be specified') if config[:paths].empty?

  config[:paths].each do |path|
    next if path[-1] == '/'

    config[:paths] << "#{path}/"
  end
end