exvo-auth 0.6.0 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/exvo-auth.gemspec +1 -1
- data/lib/exvo_auth/controllers/merb.rb +12 -1
- data/lib/exvo_auth/controllers/rails.rb +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.1
|
data/exvo-auth.gemspec
CHANGED
@@ -8,8 +8,19 @@ module ExvoAuth::Controllers::Merb
|
|
8
8
|
def authenticate_user!
|
9
9
|
super
|
10
10
|
throw :halt unless signed_in?
|
11
|
-
end
|
11
|
+
end
|
12
|
+
|
13
|
+
def authenticate_app_in_scope!(scope)
|
14
|
+
basic_authentication do |consumer_id, access_token|
|
15
|
+
@current_scopes = ExvoAuth::Autonomous::Provider.new(
|
16
|
+
:consumer_id => consumer_id,
|
17
|
+
:access_token => access_token
|
18
|
+
).scopes
|
12
19
|
|
20
|
+
@current_scopes.include?(scope)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
13
24
|
protected
|
14
25
|
|
15
26
|
def redirect_to(*args)
|
@@ -6,8 +6,6 @@ module ExvoAuth::Controllers::Rails
|
|
6
6
|
end
|
7
7
|
|
8
8
|
module InstanceMethods
|
9
|
-
protected
|
10
|
-
|
11
9
|
def authenticate_app_in_scope!(scope)
|
12
10
|
authenticate_or_request_with_http_basic do |consumer_id, access_token|
|
13
11
|
@current_scopes = ExvoAuth::Autonomous::Provider.new(
|
@@ -19,6 +17,8 @@ module ExvoAuth::Controllers::Rails
|
|
19
17
|
end
|
20
18
|
end
|
21
19
|
|
20
|
+
protected
|
21
|
+
|
22
22
|
def find_user_by_id(id)
|
23
23
|
User.find(id)
|
24
24
|
end
|