artsy-rack-auth-admin-only 0.0.2 → 0.0.3
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 +5 -1
- 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: e46aa0eb18fb3bd120985a708c5271aa32b880d4
|
4
|
+
data.tar.gz: f43d6fc0566d395cb121f88e72c52dc41056b27a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e0ac13838dca9f5adbc08e1d8ccb55bdb6f1a0dcda5beb971d418b804d9c1def39415ad4fefe26fef30ef78541f75d71ae2f08ecde3c4d3c8c5ab675ba3db7a
|
7
|
+
data.tar.gz: aa6df5d739a3ef91a2e5eaef725488bd28dfcd062745cd8974160bd80c72604e571d3821190eff934065df8fb94d21bfc5c68182a2054ca399b949c804f32ada
|
data/lib/artsy_auth/gravity.rb
CHANGED
@@ -60,7 +60,7 @@ module ArtsyAuth
|
|
60
60
|
response = open(url).read
|
61
61
|
json = JSON.parse(response)
|
62
62
|
return authorized(json) if valid_access_token?(json['access_token'])
|
63
|
-
|
63
|
+
not_admin
|
64
64
|
end
|
65
65
|
|
66
66
|
def authorized(json)
|
@@ -78,5 +78,9 @@ module ArtsyAuth
|
|
78
78
|
response.redirect OAUTH_REDIRECT, 307
|
79
79
|
response.finish
|
80
80
|
end
|
81
|
+
|
82
|
+
def not_admin
|
83
|
+
[403, { 'Content-Type' => 'text/plain' }, ['This is an Artsy-admin only page']]
|
84
|
+
end
|
81
85
|
end
|
82
86
|
end
|
data/lib/artsy_auth/version.rb
CHANGED