Sha256: 6cc15d700ed47c64333828287a8cef2daed8b7aa7f3b5e4c5526300875f489e4

Contents?: true

Size: 767 Bytes

Versions: 1

Compression:

Stored size: 767 Bytes

Contents

module Doorkeeper
  module OAuth
    module Authorization
      class Token
        attr_accessor :pre_auth, :resource_owner, :token

        def initialize(pre_auth, resource_owner)
          @pre_auth       = pre_auth
          @resource_owner = resource_owner
        end

        def issue_token
          @token ||= AccessToken.create!({
            :application_id    => pre_auth.client.id,
            :resource_owner_id => resource_owner.id,
            :scopes            => pre_auth.scopes.to_s,
            :ttl        => configuration.access_token_expires_in,
            :use_refresh_token => false
          })
        end

        def configuration
          Doorkeeper.configuration
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
couchkeeper-0.6.7 lib/doorkeeper/oauth/authorization/token.rb