fbdoorman 0.8.0.98 → 0.9.0

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.98"
21
+ gem.version = "0.9.0"
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}/**/*"]
@@ -1,5 +1,37 @@
1
1
  <div id="fb-root"></div>
2
2
  <script>
3
+
4
+ /*******Form for post ********
5
+ *
6
+ * Code by Rakesh Pai via http://stackoverflow.com/questions/133925/javascript-post-request-like-a-form-submit
7
+ */
8
+ function post_to_url(path, params, method) {
9
+ method = method || "post"; // Set method to post by default, if not specified.
10
+
11
+ // The rest of this code assumes you are not using a library.
12
+ // It can be made less wordy if you use one.
13
+ var form = document.createElement("form");
14
+ form.setAttribute("method", method);
15
+ form.setAttribute("action", path);
16
+
17
+ for(var key in params) {
18
+ var hiddenField = document.createElement("input");
19
+ hiddenField.setAttribute("type", "hidden");
20
+ hiddenField.setAttribute("name", key);
21
+ hiddenField.setAttribute("value", params[key]);
22
+
23
+ form.appendChild(hiddenField);
24
+ }
25
+
26
+ document.body.appendChild(form);
27
+ form.submit();
28
+ }
29
+
30
+
31
+ /******************
32
+ * Facebook CODE
33
+ ******************/
34
+
3
35
  window.fbAsyncInit = function() {
4
36
  FB.init({ appId: '151745734845074',
5
37
  status: true,
@@ -18,7 +50,8 @@ window.fbAsyncInit = function() {
18
50
  <%= if !signed_in? then
19
51
  "var accessToken = response.authResponse.accessToken;
20
52
  var expiration = response.authResponse.expiresIn;
21
- window.location='/facebook' + '?token=' + accessToken + '&expiration=' + expiration;"
53
+ //window.location='/facebook' + '?token=' + accessToken + '&expiration=' + expiration;
54
+ post_to_url('/facebook', {'token':accessToken, 'expiration': expiration});"
22
55
  end %>
23
56
  }
24
57
  };
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.98
4
+ version: 0.9.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: