'Returns the user using the Graph API.'

def get_user(self):

    token = self.accessToken()
    if (not token):
        return None
    user = None
    try:
        user = self.call_api(token)
    except Exception as e:
        current.session.token = None
    user_dict = None
    if user:
        table = current.auth.settings.table_user
        query = (table.email == user['email'])
        exists = current.db(query).select(table.id, table.password, limitby=(0, 1)).first()
        if exists:
            user_dict = {'googleid': user['id'], 'email': user['email'], 'password': existent.password}
        else:
            names = user.get('name', '').split()
            first = (names[0] if (len(names) > 0) else '')
            last = (names[(-1)] if (len(names) > 1) else '')
            user_dict = {'first_name': user.get('given_name', first), 'last_name': user.get('family_name', last), 'googleid': user['id'], 'nickname': ('%(first_name)s-%(last_name)s-%(id)s' % {'first_name': first.lower(), 'last_name': last.lower(), 'id': user['id'][:5]}), 'email': user['email'], 'website': user.get('link', ''), 'photo_source': (6 if user.get('picture', None) else 2), 'googlepicture': user.get('picture', ''), 'registration_type': 3}
    return user_dict
