catalogApp.py
def gdisconnect():
    '''
    Disconnects a user from her Google account.
    '''
    # Only disconnect a connected user.
    credentials = login_session.get('credentials')
    if credentials is None:
        response = make_response(
            json.dumps('Current user not connected.'), 401)
        response.headers['Content-Type'] = 'application/json'
        return response
    access_token = login_session['credentials']
    url = 'https://accounts.google.com/o/oauth2/revoke?token=%s' % access_token
    h = httplib2.Http()
    result = h.request(url, 'GET')[0]
    if result['status'] != '200':
        # For whatever reason, the given token was invalid.
        response = make_response(
            json.dumps('Failed to revoke token for given user.', 400))
        response.headers['Content-Type'] = 'application/json'
        return response

    Disconnects a user from her Google account.
    
Disconnects a user from her Google account.
Disconnects a user from her Google account .
def gdisconnect():
    credentials = login_session.get('credentials')
    if credentials is None:
        response = make_response(
            json.dumps('Current user not connected.'), 401)
        response.headers['Content-Type'] = 'application/json'
        return response
    access_token = login_session['credentials']
    url = 'https://accounts.google.com/o/oauth2/revoke?token=%s' % access_token
    h = httplib2.Http()
    result = h.request(url, 'GET')[0]
    if result['status'] != '200':
        response = make_response(
            json.dumps('Failed to revoke token for given user.', 400))
        response.headers['Content-Type'] = 'application/json'
        return response
def gdisconnect ( ) : credentials = login_session . get ( 'credentials' ) if credentials is None : response = make_response ( json . dumps ( 'Current user not connected.' ) , 401 ) response . headers [ 'Content-Type' ] = 'application/json' return response access_token = login_session [ 'credentials' ] url = 'https://accounts.google.com/o/oauth2/revoke?token=%s' % access_token h = httplib2 . Http ( ) result = h . request ( url , 'GET' ) [ 0 ] if result [ 'status' ] != '200' : response = make_response ( json . dumps ( 'Failed to revoke token for given user.' , 400 ) ) response . headers [ 'Content-Type' ] = 'application/json' return response
Disconnects a user from her Google account.
Disconnects a user from her Google account .
'''
    Disconnects a user from her Google account.
    ''' # Only disconnect a connected user. # For whatever reason, the given token was invalid.