Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Fix #41 - custom Facebook fields are not correctly appended to the oauth request url. #42

Merged
merged 1 commit into from about 1 year ago

2 participants

Olivier Vaillancourt Jed Schmidt
Olivier Vaillancourt

"this.fields" on line 44 of the facebook service always evaluate to "undefined", which would prompt facebook to poke into the page /meundefined instead of the proper /me?fields=[bla] url. (Would've also had hard-coded a query-string in the path on which a second one generated in oauth2.js would've been appended, which would've been problematic too.)

The following pull resolves the issue without removing the capability of adding custom fields by using the "this.user.query" object which was created for this purpose in the first place.

Jed Schmidt jed merged commit a74fbe9 into from March 26, 2013
Jed Schmidt jed closed this March 26, 2013
Jed Schmidt
Owner
jed commented March 26, 2013

thanks, @ovaillancourt! pushed to npm as well.

Olivier Vaillancourt

thanks!

Olivier Vaillancourt ovaillancourt deleted the branch March 27, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Mar 26, 2013
Olivier Vaillancourt Fix #41 - custom Facebook fields are not correctly appended to the oa…
…uth request url.
26eeb2a
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 3 additions and 4 deletions. Show diff stats Hide diff stats

  1. 7  lib/services/facebook.js
7  lib/services/facebook.js
@@ -17,9 +17,8 @@ function Facebook(options) {
17 17
 
18 18
   this.user.query = {}
19 19
 
20  
-  this.fields = ''
21  
-  if (options.fields) {
22  
-    this.fields = '?fields=' + options.fields.join(',')
  20
+  if(options.fields) {
  21
+    this.user.query.fields = options.fields.join( ',' )
23 22
   }
24 23
 
25 24
   this.on("request", this.onRequest.bind(this))
@@ -42,7 +41,7 @@ Facebook.prototype.token = {
42 41
 
43 42
 Facebook.prototype.user = {
44 43
   host: "graph.facebook.com",
45  
-  path: "/me" + this.fields
  44
+  path: "/me"
46 45
 }
47 46
 
48 47
 module.exports = Facebook
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.