{% extends 'base.html' %}

{% block facebook_code %}
  FB.getLoginStatus(function(response) {
    var update = $('#getLoginStatus')
    if (response.session) {
      update.text('response.session.uid = ' + response.session.uid)
    } else {
      update.text('response.session = null')     
    }
  });
{% endblock %}


{% block content %}
<table>
  <tr><td>request.user</td><td>{{ request.user }}</td></tr>
  <tr><td>request.facebook.uid</td><td>{{ request.facebook.uid }}</td></tr>
  <tr><td>request.facebook.user</td><td>{{ request.facebook.user }}</td></tr>
  <tr><td>request.COOKIES</td><td><pre>{{ request.COOKIES|pprint }}</pre></td></tr>
  <tr><td>request.POST</td><td><pre>{{ request.POST|pprint }}</pre></td></tr>
  <tr><td>FB.getLoginStatus</td><td><span id="getLoginStatus">Loading ...</span></td></tr>
</table>

<fb:login-button autologoutlink="true"></fb:login-button>

{% endblock %}

{% extends 'base.html' %}

{% block facebook_code %}
  FB.getLoginStatus(function(response) {
    var update = $('#getLoginStatus')
    if (response.status === 'connected') {
      var uid = response.authResponse.userID;
      var accessToken = response.authResponse.accessToken;
      update.text('userID = ' + response.session.uid + ', accessToken = ' + accessToken);
    } else if (response.status === 'not_authorized') {
        update.text('App is not authorized');
    } else {
      update.text('No fb user found');
    }
  });
{% endblock %}


{% block content %}
<table>
  <tr><td>request.user</td><td>{{ request.user }}</td></tr>
  <tr><td>request.facebook.uid</td><td>{{ request.facebook.uid }}</td></tr>
  <tr><td>request.facebook.user</td><td>{{ request.facebook.user }}</td></tr>
  <tr><td>request.COOKIES</td><td><pre>{{ request.COOKIES|pprint }}</pre></td></tr>
  <tr><td>request.POST</td><td><pre>{{ request.POST|pprint }}</pre></td></tr>
  <tr><td>FB.getLoginStatus</td><td><span id="getLoginStatus">Loading ...</span></td></tr>
</table>

<fb:login-button autologoutlink="true"></fb:login-button>

{% endblock %}

Update debug template to use new js sdk
Update debug template to use new js sdk

With the new oauth 2, the javascript sdk has changed as well:
https://developers.facebook.com/blog/post/525/
