Module: ArtsyAuth

Defined in:
lib/artsy_auth/gravity.rb,
lib/artsy_auth/version.rb

Overview

Gravity auth code

Defined Under Namespace

Classes: Gravity

Constant Summary collapse

VERSION =
'0.0.1'.freeze

Instance Method Summary collapse

Instance Method Details

#oauth_url(code) ⇒ Object

Generates a URL for the gravity oauth access code which the server gets given after a user successfullly logs in.



22
23
24
25
26
27
28
29
30
31
# File 'lib/artsy_auth/gravity.rb', line 22

def oauth_url(code)
  query = [
    "client_id=#{APPLICATION_ID}",
    "client_secret=#{APPLICATION_SECRET}",
    "redirect_uri=#{REDIRECT_URL}",
    "code=#{code}",
    'grant_type=authorization_code'
  ]
  "#{GRAVITY_URL}/oauth2/access_token?#{query.join('&')}"
end