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 +4 -4
- data/lib/artsy_auth/gravity.rb +2 -2
- data/lib/artsy_auth/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccf1628e27a7f2cffe18ec4af5b342e2dd3de8a1
|
4
|
+
data.tar.gz: fc304b2236bd98f83593436abab99f142be88a0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92e3a3cf629f521c962b2fab8a489468973929a19b8c4500b86075e8a02e6979b7d4e90b84a83424f670259208addf055322dbc301fafa098736325e752c7134
|
7
|
+
data.tar.gz: ca895fbe978af7e89d4775d4adb8fd3c77a75a961d5ec3568ec979ce70013c81d4ff8f6e201ca701458cc98e6bf1011686ebf07ee9732bf2fa7a146047e37450
|
data/lib/artsy_auth/gravity.rb
CHANGED
@@ -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'])
|
data/lib/artsy_auth/version.rb
CHANGED