Sha256: b114c6e866900b64d2052db478f713a329c6e20cdd2a885d37e084f6becc12e3

Contents?: true

Size: 494 Bytes

Versions: 16

Compression:

Stored size: 494 Bytes

Contents

description 'Authentication service stack'

class StackService < User::Service
  def initialize(config)
    @stack = config.map do |name|
      User::Service[name].new(Config['authentication'][name])
    end
  end

  # @override
  def authenticate(name, password)
    @stack.any? do |service|
      user = service.authenticate(name, password) rescue nil
      return user if user
    end
    raise AuthenticationError, :wrong_user_or_pw.t
  end
end

User::Service.register :stack, StackService

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
olelo-0.9.15 plugins/authentication/stack.rb
olelo-0.9.14 plugins/authentication/stack.rb
olelo-0.9.13 plugins/authentication/stack.rb
olelo-0.9.12 plugins/authentication/stack.rb
olelo-0.9.11 plugins/authentication/stack.rb
olelo-0.9.10 plugins/authentication/stack.rb
olelo-0.9.9 plugins/authentication/stack.rb
olelo-0.9.8 plugins/authentication/stack.rb
olelo-0.9.7 plugins/authentication/stack.rb
olelo-0.9.6 plugins/authentication/stack.rb
olelo-0.9.5 plugins/authentication/stack.rb
olelo-0.9.4 plugins/authentication/stack.rb
olelo-0.9.3 plugins/authentication/stack.rb
olelo-0.9.2 plugins/authentication/stack.rb
olelo-0.9.1 plugins/security/stack.rb
olelo-0.9.0 plugins/security/stack.rb