Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed bug in gdisconnect() #37

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Lesson2/step6/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def gconnect():

@app.route('/gdisconnect')
def gdisconnect():
access_token = login_session['access_token']
access_token = login_session['credentials'].access_token
print 'In gdisconnect access token is %s', access_token
print 'User name is: '
print login_session['username']
Expand All @@ -134,13 +134,13 @@ def gdisconnect():
response = make_response(json.dumps('Current user not connected.'), 401)
response.headers['Content-Type'] = 'application/json'
return response
url = 'https://accounts.google.com/o/oauth2/revoke?token=%s' % login_session['access_token']
url = 'https://accounts.google.com/o/oauth2/revoke?token=%s' % access_token
h = httplib2.Http()
result = h.request(url, 'GET')[0]
print 'result is '
print result
if result['status'] == '200':
del login_session['access_token']
del login_session['credentials']
del login_session['gplus_id']
del login_session['username']
del login_session['email']
Expand Down