Sha256: f6fcb4d2ac91f8b3b5b0606d5ca3664b35dc209a489ca61cac6e9443522f2733

Contents?: true

Size: 574 Bytes

Versions: 1

Compression:

Stored size: 574 Bytes

Contents

require_relative "../aleph_adapter"

module Skala
  class AlephAdapter::AuthenticateUser
    def initialize(adapter)
      @adapter = adapter
    end

    def call(user_id, password)
      @adapter.x_services.post(
        op: :"bor-auth",
        bor_id: user_id,
        library: @adapter.default_user_library,
        verification: password
      )
      .try do |_response|
        if  _response.include?("<z303>")
          true
        elsif  _response.include?("error")
          false
        else
          StandardError.new
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
skala-1.1.0 lib/skala/aleph_adapter/authenticate_user.rb