Browse Source

REMOVE AUTH FROM ROUTES

main
Michael Pilosov 2 years ago
parent
commit
8ee238c4de
  1. 57
      app/routes.py
  2. 2
      requirements.txt

57
app/routes.py

@ -1,18 +1,8 @@
from flask import request, jsonify, redirect, url_for, render_template
# from flask_login import LoginManager, login_user, logout_user, login_required, current_user
from app import app, db
from app.models import User
# login_manager = LoginManager()
# login_manager.init_app(app)
# login_manager.login_view = 'login'
# @login_manager.user_loader
# def load_user(user_id):
# return User.query.get(int(user_id))
# from app.models import User
@app.route('/api', methods=['POST'])
# @login_required
def process_request():
image = request.files.get('image')
text = request.form.get('text')
@ -24,48 +14,3 @@ def process_request():
app.logger.info(blocks)
app.logger.info(text)
return jsonify(success=True)
# @app.route('/signup', methods=['GET', 'POST'])
# def signup():
# if current_user.is_authenticated:
# return redirect(url_for('process_request'))
# if request.method == 'POST':
# username = request.form['username']
# password = request.form['password']
# user = User.query.filter_by(username=username).first()
# if user is None:
# new_user = User(username=username)
# new_user.set_password(password)
# db.session.add(new_user)
# db.session.commit()
# return redirect(url_for('login'))
# else:
# return "User already exists"
# return render_template('signup.html')
# @app.route('/login', methods=['GET', 'POST'])
# def login():
# if current_user.is_authenticated:
# return redirect(url_for('process_request'))
# if request.method == 'POST':
# username = request.form['username']
# password = request.form['password']
# user = User.query.filter_by(username=username).first()
# if user and user.check_password(password):
# login_user(user)
# return redirect(url_for('process_request'))
# else:
# return "Invalid username or password"
# return render_template('login.html')
# @app.route('/logout')
# @login_required
# def logout():
# logout_user()
# return redirect(url_for('login'))

2
requirements.txt

@ -2,5 +2,5 @@ flask
flask_sqlalchemy
psycopg2-binary
flask_bcrypt
flask_login
# flask_login
flask_cors
Loading…
Cancel
Save