コード例 #1
0
def update_profile():
    """Update user profile (names and email)

    Returns
    -------
    json
        The updated user
    """
    data = request.get_json()
    online_user = session['user']
    local_auth = LocalAuth(ca, session)
    result = local_auth.update_profile(data, online_user)
    result['user']['_id'] = str(result['user']['_id'])
    session['user'] = result['user']
    return kill_apollo_session(result)
コード例 #2
0
def update_profile():
    """Update user profile (names and email)

    Returns
    -------
    json
        The updated user
    """
    data = request.get_json()

    local_auth = LocalAuth(current_app, session)
    updated_user = local_auth.update_profile(data, session['user'])

    session['user'] = updated_user['user']

    return jsonify({
        'error': updated_user['error'],
        'errorMessage': updated_user['error_message'],
        'user': updated_user['user']
    })