- FB.init(FB_API_KEY, FB_CHANNEL_PATH, {permsToRequestOnConnect : "email"});\r
-\r
- function FB_ConnectPostAuthorization() {\r
- if ($('#validate_email').attr('checked')) {\r
- FB_RequireFeatures(["Api"], function(){\r
- var api = FB.Facebook.apiClient;\r
- var fb_uid = api.get_session().uid;\r
-\r
- $.post('{% url facebook_user_is_registered %}', {'fb_uid': fb_uid}, function(response) {\r
- if (response != "yes") {\r
- api.users_hasAppPermission("email", function(result) {\r
- if (!result) {\r
- FB.Connect.showPermissionDialog("email", redirect_to_done_page);\r
- } else {\r
- redirect_to_done_page()\r
- }\r
- })\r
+<div id="fb-root"></div>\r
+<script src="http://connect.facebook.net/en_US/all.js"></script>\r
+<script>\r
+ function check_login_status() {\r
+ var FB_API_KEY = "{{ provider.API_KEY }}";\r
+ FB.init({\r
+ appId:FB_API_KEY, cookie:true,\r
+ status:true, xfbml:true\r
+ });\r
+ FB.getLoginStatus(function(response) {\r
+ if (response.session) {\r
+ redirect_to_done_page();\r
+ } else {\r
+ FB.login(function(response) {\r
+ if (response.session) {\r
+ redirect_to_done_page();\r