class Rack::OAuth2::AccessToken::Legacy

Public Class Methods

new(attributes = {}) click to toggle source
Calls superclass method Rack::OAuth2::AccessToken.new
# 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

Public Instance Methods

authenticate(request) click to toggle source
# File lib/rack/oauth2/access_token/legacy.rb, line 13
def authenticate(request)
  request.header["Authorization"] = "OAuth #{access_token}"
end