Module: Wor::Authentication

Defined in:
lib/wor/authentication.rb,
lib/wor/authentication/version.rb,
lib/wor/authentication/controller.rb,
lib/wor/authentication/exceptions.rb,
lib/wor/authentication/decoded_token.rb,
lib/wor/authentication/token_manager.rb,
lib/wor/authentication/sessions_controller.rb,
lib/generators/wor/authentication/install_generator.rb

Defined Under Namespace

Modules: Controller, Exceptions, Generators, SessionsController Classes: DecodedToken, TokenManager

Constant Summary collapse

VERSION =
'0.2.2'.freeze

Class Method Summary collapse

Class Method Details

.configObject



33
34
35
# File 'lib/wor/authentication.rb', line 33

def self.config
  @config
end

.configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



15
16
17
# File 'lib/wor/authentication.rb', line 15

def self.configure
  yield self
end

.expiration_daysObject



37
38
39
# File 'lib/wor/authentication.rb', line 37

def self.expiration_days
  @config[:expiration_days]
end

.expiration_days=(expiration_days) ⇒ Object



19
20
21
22
23
24
# File 'lib/wor/authentication.rb', line 19

def self.expiration_days=(expiration_days)
  unless expiration_days.is_a? Integer
    raise Wor::Authentication::Exceptions::InvalidExpirationDaysError
  end
  @config[:expiration_days] = expiration_days
end

.maximum_useful_daysObject



41
42
43
# File 'lib/wor/authentication.rb', line 41

def self.maximum_useful_days
  @config[:maximum_useful_days]
end

.maximum_useful_days=(maximum_useful_days) ⇒ Object



26
27
28
29
30
31
# File 'lib/wor/authentication.rb', line 26

def self.maximum_useful_days=(maximum_useful_days)
  unless maximum_useful_days.is_a? Integer
    raise Wor::Authentication::Exceptions::InvalidMaximumUsefulDaysError
  end
  @config[:maximum_useful_days] = maximum_useful_days
end