Class: Auth::Middleware::Request

Inherits:
Rack::Auth::AbstractRequest
  • Object
show all
Defined in:
lib/auth/middleware.rb

Instance Method Summary collapse

Instance Method Details

#access_tokenObject



61
62
63
64
# File 'lib/auth/middleware.rb', line 61

def access_token
  @access_token ||= params ? params.unpack("m*").first :
                             request.params['access_token']
end

#account_idObject



66
67
68
# File 'lib/auth/middleware.rb', line 66

def 
  @account_id ||= Auth.validate_token(access_token)
end

#bearer?Boolean

Returns:

  • (Boolean)


49
50
51
# File 'lib/auth/middleware.rb', line 49

def bearer?
  :bearer == scheme
end

#partsObject



57
58
59
# File 'lib/auth/middleware.rb', line 57

def parts
  authorization_key ? super : ['Bearer', nil]
end

#provided?Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/auth/middleware.rb', line 53

def provided?
  super || request.params['access_token']
end