diff --git a/backend/routes_auth.py b/backend/routes_auth.py index 7c98bf39b9278555121c86cd83dcf1cf11405f4b..bd370d5193c684200fe94c8898d458b672947e9c 100644 --- a/backend/routes_auth.py +++ b/backend/routes_auth.py @@ -3,25 +3,15 @@ from flask_security import auth_required, logout_user, verify_password, login_us auth = Blueprint("auth", __name__) -@auth.route("/login", methods=["POST"]) -def login(): - if request.method == 'POST': - data = request.get_json() - unorm = current_app.security._username_util.normalize(data["username"]) - user = current_app.security.datastore.find_user(username=unorm) - if user is not None: - pnorm = current_app.security._password_util.normalize(data["password"]) - - # Compare the supplied hash with the stored hash for the user - if verify_password(pnorm, user.password): - login_user(user, remember=False) - return jsonify(success=True) - else: - return jsonify(success=False, message="Invalid username or password") - @auth.route("/logout", methods=["POST"]) @auth_required() def logout(): logout_user() return jsonify(success=True) + + +@auth.route("/api/stats") +@auth_required() +def get_data(): + pass \ No newline at end of file