Sha256: 4b061638c3190a70354d8a531f2f1e6659060b02f83b05d508c073125e46fe45

Contents?: true

Size: 814 Bytes

Versions: 2

Compression:

Stored size: 814 Bytes

Contents

# frozen_string_literal: true

module WineBouncer
  module AuthMethods

    def protected_endpoint=(protected)
      @protected_endpoint = protected
    end

    def protected_endpoint?
      @protected_endpoint || false
    end

    def resource_owner
       instance_eval(&WineBouncer.configuration.defined_resource_owner)
    end

    def client_credential_token?
      has_doorkeeper_token? && doorkeeper_access_token.resource_owner_id.nil?
    end

    def doorkeeper_access_token
      @_doorkeeper_access_token
    end

    def doorkeeper_access_token=(token)
      @_doorkeeper_access_token = token
    end

    def has_doorkeeper_token?
      !@_doorkeeper_access_token.nil?
    end

    def has_resource_owner?
      has_doorkeeper_token? && !!doorkeeper_access_token.resource_owner_id
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
privy_wine_bouncer-1.0.4.5 lib/wine_bouncer/auth_methods/auth_methods.rb
wine_bouncer-1.0.4 lib/wine_bouncer/auth_methods/auth_methods.rb