Skip to content

Commit

Permalink
Merge pull request mobolic#259 from dragonfly90/master
Browse files Browse the repository at this point in the history
Fix issues with Flask example.
  • Loading branch information
martey committed Dec 31, 2015
2 parents 4317ff6 + fe4d83d commit 17f1eb2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 0 additions & 5 deletions examples/flask/app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,5 @@
{% block content %} {% endblock %}
</div>

<script>
document.getElementById('logout').onclick = function() {
FB.logout(function(response) { });
};
</script>
</body>
</html>
6 changes: 6 additions & 0 deletions examples/flask/app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,11 @@
</p>
<h3>Hello, {{ user['name'] }}.</h3>
<a href="/logout" id="logout">Log out</a>
<script>
document.getElementById('logout').onclick = function() {
FB.logout(function(response) { });
};
</script>

</div>
{% endblock %}
2 changes: 2 additions & 0 deletions examples/flask/app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ def get_current_user():
# Not an existing user so get info
graph = GraphAPI(result['access_token'])
profile = graph.get_object('me')
if 'link' not in profile:
profile['link'] = ""

# Create the user and insert it into the database
user = User(id=str(profile['id']), name=profile['name'],
Expand Down

0 comments on commit 17f1eb2

Please sign in to comment.