artsy-rack-auth-admin-only 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5ec702cdb9b2288278b0bb5d63eb347fadbf1890
4
- data.tar.gz: fe0c6e0e4c2543816d55297cdf66c0d134964928
3
+ metadata.gz: ccf1628e27a7f2cffe18ec4af5b342e2dd3de8a1
4
+ data.tar.gz: fc304b2236bd98f83593436abab99f142be88a0a
5
5
  SHA512:
6
- metadata.gz: 2ec4af4c2c4b9d4db2940c20c5c1326fde72793455e6c6b07d1031a94ced49a31135ebcae167a38d182068fb01e34fee810d8a294b3687698df50924484a43de
7
- data.tar.gz: a7753bf119dd6f976b285cf670eb3fe37f332fe5c2f1c97d862a1d5c8aa38a4cab8bf5afe40e8e52fb3c8a404865bf95718029db4a249ce9c979950541213afb
6
+ metadata.gz: 92e3a3cf629f521c962b2fab8a489468973929a19b8c4500b86075e8a02e6979b7d4e90b84a83424f670259208addf055322dbc301fafa098736325e752c7134
7
+ data.tar.gz: ca895fbe978af7e89d4775d4adb8fd3c77a75a961d5ec3568ec979ce70013c81d4ff8f6e201ca701458cc98e6bf1011686ebf07ee9732bf2fa7a146047e37450
@@ -19,7 +19,7 @@ COOKIE_EXP = Time.now + 7 * 24 * 60 * 60
19
19
  module ArtsyAuth
20
20
  # Generates a URL for the gravity oauth access code which the server gets
21
21
  # given after a user successfullly logs in.
22
- def oauth_url(code)
22
+ def self.oauth_url(code)
23
23
  query = [
24
24
  "client_id=#{APPLICATION_ID}",
25
25
  "client_secret=#{APPLICATION_SECRET}",
@@ -56,7 +56,7 @@ module ArtsyAuth
56
56
  def authorize(env)
57
57
  query = Rack::Utils.parse_nested_query(env['QUERY_STRING'])
58
58
  code = query['code']
59
- url = oauth_url(code)
59
+ url = ArtsyAuth.oauth_url(code)
60
60
  response = open(url).read
61
61
  json = JSON.parse(response)
62
62
  return authorized(json) if valid_access_token?(json['access_token'])
@@ -1,5 +1,5 @@
1
1
  # -*- coding: utf-8 -*- #
2
2
 
3
3
  module ArtsyAuth
4
- VERSION = '0.0.1'.freeze
4
+ VERSION = '0.0.2'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: artsy-rack-auth-admin-only
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orta Therox