'Returns the user using the Graph API.'

def get_user(self):

    token = self.accessToken()
    if (not token):
        return None
    session = current.session
    user = None
    try:
        user = self.call_api(token)
    except Exception as e:
        session.token = None
    user_dict = None
    if user:
        table = current.auth.settings.table_user
        query = (table.email == user['email'])
        existent = current.db(query).select(table.id, table.password, limitby=(0, 1)).first()
        if existent:
            user_dict = {'humanitarian_id': user['user_id'], 'email': user['email'], 'password': existent.password}
        else:
            user_dict = {'first_name': user.get('name_given', ''), 'last_name': user.get('name_family', ''), 'humanitarian_id': user['user_id'], 'email': user['email'], 'registration_type': 3}
    return user_dict
