Class: Rack::OAuth2::AccessToken::Legacy

Inherits:
Rack::OAuth2::AccessToken show all
Defined in:
lib/rack/oauth2/access_token/legacy.rb

Instance Attribute Summary

Attributes inherited from Rack::OAuth2::AccessToken

#raw_attributes

Instance Method Summary collapse

Methods inherited from Rack::OAuth2::AccessToken

#token_response

Constructor Details

#initialize(attributes = {}) ⇒ Legacy

Returns a new instance of Legacy.



5
6
7
8
9
10
11
# File 'lib/rack/oauth2/access_token/legacy.rb', line 5

def initialize(attributes = {})
  super
  self.expires_in = (
    self.expires_in ||
    attributes[:expires]
  ).try(:to_i)
end

Instance Method Details

#authenticate(request) ⇒ Object



13
14
15
# File 'lib/rack/oauth2/access_token/legacy.rb', line 13

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