Sha256: 7a65d8fce4b49c831ebff8cd316e1886aace1042782efc6ec9784949400bbf09

Contents?: true

Size: 491 Bytes

Versions: 11

Compression:

Stored size: 491 Bytes

Contents

module Rack
  module OAuth2
    class AccessToken
      class Legacy < AccessToken
        def initialize(attributes = {})
          super
          self.expires_in = (
            self.expires_in ||
            attributes[:expires]
          ).try(:to_i)
        end

        def to_s # This is for fb_graph
          self.access_token
        end

        def authenticate(request)
          request.header["Authorization"] = "OAuth #{access_token}"
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
rack-oauth2-1.0.10 lib/rack/oauth2/access_token/legacy.rb
rack-oauth2-1.0.9 lib/rack/oauth2/access_token/legacy.rb
rack-oauth2-1.0.8 lib/rack/oauth2/access_token/legacy.rb
rack-oauth2-revibe-1.0.7 lib/rack/oauth2/access_token/legacy.rb
rack-oauth2-1.0.7 lib/rack/oauth2/access_token/legacy.rb
rack-oauth2-1.0.6 lib/rack/oauth2/access_token/legacy.rb
rack-oauth2-1.0.5 lib/rack/oauth2/access_token/legacy.rb
rack-oauth2-1.0.4 lib/rack/oauth2/access_token/legacy.rb
rack-oauth2-1.0.3 lib/rack/oauth2/access_token/legacy.rb
rack-oauth2-1.0.2 lib/rack/oauth2/access_token/legacy.rb
rack-oauth2-1.0.1 lib/rack/oauth2/access_token/legacy.rb