Sha256: 1e71962742e60c9f7d95bb9c402aaf8a8378478813d4ea91c7d04150e0698de4

Contents?: true

Size: 765 Bytes

Versions: 18

Compression:

Stored size: 765 Bytes

Contents

module Doorkeeper
  module OAuth
    module Authorization
      class Code
        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 ||= AccessGrant.create!(
            :application_id    => pre_auth.client.id,
            :resource_owner_id => resource_owner.id,
            :expires_in        => configuration.authorization_code_expires_in,
            :redirect_uri      => pre_auth.redirect_uri,
            :scopes            => pre_auth.scopes.to_s
          )
        end

        def configuration
          Doorkeeper.configuration
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
doorkeeper-1.1.0 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-1.0.0 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-1.0.0.rc2 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-1.0.0.rc1 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-0.7.4 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-0.7.3 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-0.7.2 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-0.7.1 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-0.7.0 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-0.6.7 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-0.6.6 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-0.6.5 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-0.6.4 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-0.6.3 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-0.6.2 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-0.6.1 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-0.6.0 lib/doorkeeper/oauth/authorization/code.rb
doorkeeper-0.6.0.rc1 lib/doorkeeper/oauth/authorization/code.rb