Skip to content

Commit

Permalink
Scope shouldnt default to email, it should default to nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
mmurray committed Feb 19, 2011
1 parent 4999e75 commit 287947a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The tag takes three optional parameters.

- `label` which defaults to *Sign in with Facebook*
- `cssClass` which defaults to *play-fbconnect-button*
- `scope` which defaults to *email* (see [the facebook docs](http://developers.facebook.com/docs/authentication/permissions) for possible values of scope)
- `scope` which is excluded by default (see [the facebook docs](http://developers.facebook.com/docs/authentication/permissions) for possible values of scope)

### Define your OAuth callback

Expand Down
2 changes: 1 addition & 1 deletion documentation/manual/home.textile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ bc. #{fbconnect.button label:'Login using your facebook account.' /}

* @label@ which defaults to *Sign in with Facebook*
* @cssClass@ which defaults to *play-fbconnect-button*
* @scope@ which defaults to *email* (see "this table":http://developers.facebook.com/docs/authentication/permissions for possible values of scope)
* @scope@ which is excluded by default (see "this table":http://developers.facebook.com/docs/authentication/permissions for possible values of scope)

h3. Define your OAuth callback

Expand Down
6 changes: 5 additions & 1 deletion src/play/modules/fbconnect/FBConnectSession.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ public String getLoginUrl() {
}

public String getLoginUrl(String scope){
return String.format("https://www.facebook.com/dialog/oauth?client_id=%s&display=%s&redirect_uri=%s&scope=%s", WS.encode(id), WS.encode("page"), WS.encode(Router.getFullUrl("FBConnect.callback")), scope);
String url = String.format("https://www.facebook.com/dialog/oauth?client_id=%s&display=%s&redirect_uri=%s", WS.encode(id), WS.encode("page"), WS.encode(Router.getFullUrl("FBConnect.callback")));
if(scope != null){
url += "&scope="+WS.encode(scope);
}
return url;
}

public String getAuthUrl(String authCode){
Expand Down

0 comments on commit 287947a

Please sign in to comment.