From d9a143518f8e4c164c5a536de829c9cbd58e0e2c Mon Sep 17 00:00:00 2001 From: Cho Date: Wed, 3 Apr 2013 03:55:53 +0100 Subject: got connectToFacebook working with code and redirect_uri passed as LLSD body in POST request --- indra/newview/llpanelpeople.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index cbc5eba65f..f55459afec 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -80,6 +80,7 @@ static const std::string FBCTEST_TAB_NAME = "fbctest_panel"; static const std::string COLLAPSED_BY_USER = "collapsed_by_user"; static const std::string FBC_SERVICES_URL = "https://pdp15.lindenlab.com"; +static const std::string FBC_SERVICES_REDIRECT_URI = "https://pdp15.lindenlab.com/"; /** Comparator for comparing avatar items by last interaction date */ class LLAvatarItemRecentComparator : public LLAvatarItemComparator @@ -1769,7 +1770,7 @@ public: else if (mShowLoginIfNotConnected) { LLFloaterWebContent::Params p; - p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_URL + "/"); + p.url("https://www.facebook.com/dialog/oauth?client_id=565771023434202&redirect_uri=" + FBC_SERVICES_REDIRECT_URI); mPanelPeople->openFacebookWeb(p); } } @@ -1818,8 +1819,10 @@ void LLPanelPeople::loadFacebookFriends() void LLPanelPeople::connectToFacebook(const std::string& auth_code) { - llinfos << "attempting to connect to facebook with code " << auth_code << llendl; - LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect/" + auth_code, LLSD(), new FacebookConnectResponder(this)); + LLSD body; + body["code"] = auth_code; + body["redirect_uri"] = FBC_SERVICES_REDIRECT_URI; + LLHTTPClient::post(FBC_SERVICES_URL + "/agent/" + gAgentID.asString() + "/fbc/connect", body, new FacebookConnectResponder(this)); } void LLPanelPeople::disconnectFromFacebook() -- cgit v1.2.3