Permalink
Browse files

Fix client. Add tokengetter.

  • Loading branch information...
lepture committed Nov 21, 2013
1 parent 49383f3 commit ac3b88d0eac572bb216c3aeea6a359872866cfdb
Showing with 10 additions and 2 deletions.
  1. +10 −2 client.py
View
@@ -28,7 +28,8 @@
@app.route('/')
def home():
if 'example_oauth' in session:
return session['example_oauth']
resp = remote.get('me')
return jsonify(resp.data)
return remote.authorize(callback=url_for('authorized', _external=True))
@@ -40,11 +41,18 @@ def authorized(resp):
request.args['error']
)
if 'oauth_token' in resp:
session['dev_oauth'] = resp
session['example_oauth'] = resp
return jsonify(resp)
return str(resp)
@remote.tokengetter
def example_oauth_token():
if 'example_oauth' in session:
resp = session['example_oauth']
return resp['oauth_token'], resp['oauth_token_secret']
import logging
logger = logging.getLogger('flask_oauthlib')
logger.addHandler(logging.StreamHandler())

0 comments on commit ac3b88d

Please sign in to comment.