Example #1
0
def update_password():
    """Update user password

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

    online_user = session['user']
    local_auth = LocalAuth(ca, session)
    result = local_auth.update_password(data, online_user)
    if '_id' in result['user']:
        result['user']['_id'] = str(result['user']['_id'])
        session['user'] = result['user']
    return result
Example #2
0
def update_password():
    """Update the user passord

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

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

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