fbdoorman 0.8.0.95 → 0.8.0.97
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/Rakefile +1 -1
- data/app/controllers/clearance/facebook_controller.rb +3 -2
- data/app/views/facebook/_fbjs.html.erb +5 -8
- data/lib/fbdoorman.rb +0 -1
- metadata +2 -2
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.97"
|
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}/**/*"]
|
@@ -8,11 +8,12 @@ class Clearance::FacebookController < ApplicationController
|
|
8
8
|
#The code arrives here
|
9
9
|
user_id = token_user(params[:token])
|
10
10
|
if user_id != nil then
|
11
|
+
@user = nil
|
11
12
|
@user = find_fbuser(user_id) #The one from the DB
|
12
13
|
#If the user exists
|
13
|
-
if
|
14
|
+
if !@user.nil? then
|
14
15
|
sign_in(@user, params[:token], params[:expiration])
|
15
|
-
redirect_to LOGGED_PATH
|
16
|
+
redirect_to LOGGED_PATH
|
16
17
|
else #If theres no user with that id
|
17
18
|
#Register this user
|
18
19
|
register_fbu(params[:token])
|
@@ -15,15 +15,12 @@ window.fbAsyncInit = function() {
|
|
15
15
|
// the user's ID, a valid access token, a signed
|
16
16
|
// request, and the time the access token
|
17
17
|
// and signed request each expire
|
18
|
-
|
18
|
+
<%= if !signed_in? then
|
19
|
+
"var accessToken = response.authResponse.accessToken;
|
19
20
|
var expiration = response.authResponse.expiresIn;
|
20
|
-
window.location=
|
21
|
-
|
22
|
-
|
23
|
-
//but not connected to the app
|
24
|
-
} else {
|
25
|
-
// the user isn't even logged in to Facebook.
|
26
|
-
}
|
21
|
+
window.location='/facebook' + '?token=' + accessToken + '&expiration=' + expiration;"
|
22
|
+
end %>
|
23
|
+
}
|
27
24
|
};
|
28
25
|
|
29
26
|
// run once with current status and whenever the status changes
|
data/lib/fbdoorman.rb
CHANGED
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.
|
4
|
+
version: 0.8.0.97
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2011-12-
|
14
|
+
date: 2011-12-17 00:00:00.000000000Z
|
15
15
|
dependencies: []
|
16
16
|
description: Painless user registration and sign-in using Facebook single sign-on
|
17
17
|
with JS. Typical email login still works too.
|