Skip to content

Commit

Permalink
Fix client. Add tokengetter.
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Nov 21, 2013
1 parent 49383f3 commit ac3b88d
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions client.py
Expand Up @@ -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))


Expand All @@ -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())
Expand Down

0 comments on commit ac3b88d

Please sign in to comment.