@app.route('/oauth/authorized')
def authorized():
    resp = remote.authorized_response()
    if (resp is None):
        return ('Access denied: error=%s' % request.args['error'])
    if (isinstance(resp, dict) and ('access_token' in resp)):
        session['access_token'] = (resp['access_token'], '')
        if return_response:
            return_response(resp)
    if success_callback:
        success_callback()
    target = session.get(REDIRECT_KEY)
    if target:
        session.pop(REDIRECT_KEY)
        return redirect(target)
    return redirect(url_for('index'))
@app.route('/oauth/authorized')
def authorized():
    resp = remote.authorized_response()
    if (resp is None):
        return ('Access denied: error=%s' % request.args['error'])
    if (isinstance(resp, dict) and ('access_token' in resp)):
        session['access_token'] = (resp['access_token'], )
        if return_response:
            return_response(resp)
    if success_callback:
        success_callback()
    target = session.get(REDIRECT_KEY)
    if target:
        session.pop(REDIRECT_KEY)
        return redirect(target)
    return redirect(url_for('index'))