rack-oauth 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/rack-oauth.rb +8 -8
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.5
|
data/lib/rack-oauth.rb
CHANGED
@@ -39,12 +39,12 @@ module Rack #:nodoc:
|
|
39
39
|
#
|
40
40
|
# You can use the token to make GET/POST/etc requests
|
41
41
|
def get_access_token name = nil
|
42
|
-
|
42
|
+
oauth_instance(name).get_access_token(oauth_request_env)
|
43
43
|
end
|
44
44
|
|
45
45
|
# Same as #get_access_token but it clears the access token out of the session.
|
46
46
|
def get_access_token! name = nil
|
47
|
-
|
47
|
+
oauth_instance(name).get_access_token!(oauth_request_env)
|
48
48
|
end
|
49
49
|
|
50
50
|
# [Internal] this method returns the Rack 'env' for the current request.
|
@@ -63,7 +63,7 @@ module Rack #:nodoc:
|
|
63
63
|
end
|
64
64
|
|
65
65
|
# Returns the instance of Rack::OAuth given a name (defaults to the default Rack::OAuth name)
|
66
|
-
def
|
66
|
+
def oauth_instance name = nil
|
67
67
|
oauth = Rack::OAuth.get(oauth_request_env, nil)
|
68
68
|
raise "Couldn't find Rack::OAuth instance with name #{ name }" unless oauth
|
69
69
|
oauth
|
@@ -71,7 +71,7 @@ module Rack #:nodoc:
|
|
71
71
|
|
72
72
|
# Returns the path to rediret to for logging in via OAuth
|
73
73
|
def oauth_login_path name = nil
|
74
|
-
|
74
|
+
oauth_instance(name).login_path
|
75
75
|
end
|
76
76
|
|
77
77
|
end
|
@@ -104,10 +104,10 @@ module Rack #:nodoc:
|
|
104
104
|
end
|
105
105
|
|
106
106
|
DEFAULT_OPTIONS = {
|
107
|
-
:login_path
|
108
|
-
:callback_path
|
109
|
-
:redirect_to
|
110
|
-
:rack_session
|
107
|
+
:login_path => '/oauth_login',
|
108
|
+
:callback_path => '/oauth_callback',
|
109
|
+
:redirect_to => '/oauth_complete',
|
110
|
+
:rack_session => 'rack.session'
|
111
111
|
}
|
112
112
|
|
113
113
|
# the URL that should initiate OAuth and redirect to the OAuth provider's login page
|