make auth work correctly

This commit is contained in:
tylen
2025-11-01 11:43:09 +02:00
parent a50a06d371
commit 014a8fc1ff
4 changed files with 163 additions and 22 deletions

View File

@@ -7,6 +7,7 @@ user.py is a source for all user endpoints.
from flask import request, jsonify
import os
import mysql.connector
def registerUserEndpoints(app, database):
@app.route('/users/isSet', methods=['GET'])
@@ -15,7 +16,7 @@ def registerUserEndpoints(app, database):
try:
query = "SELECT * FROM users WHERE Name=%s"
result = database.query(query, params=(user_name,))
return jsonify(bool(result and result[0][2])), 200
return jsonify(bool(result)), 200
except mysql.connector.Error as err:
# Log the error or handle it as necessary
app.logger.error(f"Error: {err}")