@app.route('/actualizarImagen', methods=['POST'])
@token_required
def actualizarImagen(current_user):
    user = Usuario.query.filter_by(nick=current_user).first()
    if (request.files['nueva_foto'] is not None):
        file = request.files['nueva_foto']
        print(request.files['nueva_foto'])
        filename = secure_filename(file.filename)
        file.save(os.path.join(ABSOLUTE_PATH_TO_YOUR_FOLDER, filename))
        user.foto_de_perfil = filename
        db.session.commit()
    token = jwt.encode({'nick': current_user, 'exp': (datetime.datetime.utcnow() + datetime.timedelta(minutes=30))}, app.config['SECRET_KEY'])
    return jsonify({'token': token.decode('UTF-8')})
@app.route('/actualizarImagen', methods=['POST'])
@token_required
def actualizarImagen(current_user):
    user = Usuario.query.filter_by(nick=current_user).first()
    if (request.files['nueva_foto'] is not None):
        file = request.files['nueva_foto']
        print(request.files['nueva_foto'])
        filename = secure_filename(file.filename)
        file.save(os.path.join(ABSOLUTE_PATH_TO_YOUR_FOLDER, filename))
        user.foto_de_perfil = filename
        db.session.commit()
    token = jwt.encode({'nick': current_user, 'exp': (datetime.datetime.utcnow() + datetime.timedelta(minutes=30))}, app.config['SECRET_KEY'])
    return jsonify({'token': token.decode('UTF-8')})