mogli 0.0.31 → 0.0.32
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mogli/authenticator.rb +1 -1
- data/spec/authenticator_spec.rb +9 -1
- metadata +4 -4
data/lib/mogli/authenticator.rb
CHANGED
@@ -17,7 +17,7 @@ module Mogli
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def access_token_url(code)
|
20
|
-
"https://graph.facebook.com/oauth/access_token?client_id=#{client_id}&redirect_uri=#{CGI.escape(callback_url)}&client_secret=#{secret}&code=#{CGI.escape(code)}"
|
20
|
+
"https://graph.facebook.com/oauth/access_token?client_id=#{client_id}&redirect_uri=#{CGI.escape(callback_url) if !callback_url.blank?}&client_secret=#{secret}&code=#{CGI.escape(code)}"
|
21
21
|
end
|
22
22
|
|
23
23
|
def get_access_token_for_session_key(session_keys)
|
data/spec/authenticator_spec.rb
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
describe Mogli::Authenticator do
|
3
|
-
|
4
3
|
let :authenticator do
|
5
4
|
Mogli::Authenticator.new("123456","secret","http://example.com/url")
|
6
5
|
end
|
@@ -89,4 +88,13 @@ describe Mogli::Authenticator do
|
|
89
88
|
|
90
89
|
end
|
91
90
|
|
91
|
+
context "Oauth2" do
|
92
|
+
let :oauth2_authenticator do
|
93
|
+
Mogli::Authenticator.new("123456","secret",nil)
|
94
|
+
end
|
95
|
+
it "creates the access_token_url without a redirect URL" do
|
96
|
+
oauth2_authenticator.access_token_url("mycode").should == "https://graph.facebook.com/oauth/access_token?client_id=123456&redirect_uri=&client_secret=secret&code=mycode"
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
92
100
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mogli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 95
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 32
|
10
|
+
version: 0.0.32
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mike Mangino
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-31 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|