fbdoorman 0.8.0.93 → 0.8.0.94
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/app/views/facebook/_fbjs.html.erb +19 -10
- metadata +1 -1
data/Rakefile
CHANGED
@@ -18,7 +18,7 @@ Jeweler::Tasks.new do |gem|
|
|
18
18
|
gem.summary = "Rails authentication with facebook single sign-on OR email & password."
|
19
19
|
gem.description = "Painless user registration and sign-in using Facebook single sign-on with JS. Typical email login still works too."
|
20
20
|
gem.email = "pelaez89@gmail.com"
|
21
|
-
gem.version = "0.8.0.
|
21
|
+
gem.version = "0.8.0.94"
|
22
22
|
gem.homepage = "http://github.com/davidpelaez/minifb-clearance"
|
23
23
|
gem.authors = ["Fbdoorman: David Pelaez","MiniFB: Appoxy","Clearance: Thoughtbot"]
|
24
24
|
gem.files = FileList["[A-Z]*", "{app,config,generators,lib,shoulda_macros,rails}/**/*"]
|
@@ -9,19 +9,28 @@ window.fbAsyncInit = function() {
|
|
9
9
|
|
10
10
|
|
11
11
|
function manageStatus(response) {
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
12
|
+
if (response.status === 'connected') {
|
13
|
+
// the user is logged in and connected to your
|
14
|
+
// app, and response.authResponse supplies
|
15
|
+
// the user's ID, a valid access token, a signed
|
16
|
+
// request, and the time the access token
|
17
|
+
// and signed request each expire
|
18
|
+
var accessToken = response.authResponse.accessToken;
|
19
|
+
var expiration = response.authResponse.expiresIn;
|
20
|
+
window.location="<%=FB_CALLBACK_URL%>" + "?token=" + accessToken + "&expiration=" + expiration;
|
21
|
+
} else if (response.status === 'not_authorized') {
|
22
|
+
// the user is logged in to Facebook,
|
23
|
+
//but not connected to the app
|
24
|
+
} else {
|
25
|
+
// the user isn't even logged in to Facebook.
|
26
|
+
alert("YOUR OUT");
|
27
|
+
}
|
20
28
|
};
|
21
29
|
|
22
30
|
// run once with current status and whenever the status changes
|
23
|
-
FB.getLoginStatus(
|
24
|
-
FB.Event.subscribe('auth.statusChange',
|
31
|
+
FB.getLoginStatus(manageStatus);
|
32
|
+
FB.Event.subscribe('auth.statusChange', manageStatus);
|
33
|
+
FB.Event.subscribe('auth.logout', function(response){ window.location="<%=FB_CLOSED_URL%>"; });
|
25
34
|
};
|
26
35
|
|
27
36
|
//Load the FB JS SDK
|