Module: Auth

Defined in:
lib/auth.rb,
lib/auth/behavior/core.rb,
lib/auth/configuration.rb,
lib/auth/behavior/remember_me.rb

Defined Under Namespace

Modules: Behavior, BehaviorLookup Classes: Configuration, Model, Observer, TargetList, Token

Class Method Summary collapse

Class Method Details

.configurationObject



14
15
16
# File 'lib/auth.rb', line 14

def configuration
  @configuration ||= Auth::Configuration.new
end

.configure {|configuration| ... } ⇒ Object

Yields:



18
19
20
# File 'lib/auth.rb', line 18

def configure
  yield configuration
end

.configure!Object Also known as: kick!

Applies all configuration settings. This is done by the Auth system after it has been configured but before it processes any requests.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/auth.rb', line 24

def configure!
  begin
    configuration.apply!
  rescue NameError
    puts
    puts "WARNING: #{$!.message}"
    puts
    puts "This happened while trying to configure Sparkly Authentication."
    puts "You should verify that /config/initializers/sparkly_authentication.rb"
    puts "is set up properly. It could be that you just haven't created the"
    puts "model yet. If so, this error will disappear when the model exists."
    puts
    if ENV['AUTH_BACKTRACE']
      puts $!.backtrace
    else
      puts "(Run with AUTH_BACKTRACE=true to see a full bactrace.)"
    end
    puts
  end
end

.reset_configuration!Object

Useful for cleaning up after tests, but probably not much else.



46
47
48
# File 'lib/auth.rb', line 46

def reset_configuration!
  @configuration = Auth::Configuration.new
end