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 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.93"
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
- if (response.authResponse) {
14
- //The user is logged in
15
- alert("YOU'r Inside");
16
- }else{
17
- //The user is either not logged in or hasn't authorized the app
18
- alert("You'r session's no longer valid");
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(updateButton);
24
- FB.Event.subscribe('auth.statusChange', updateButton);
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fbdoorman
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0.93
4
+ version: 0.8.0.94
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: