Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -63,6 +63,7 @@ global colorsused
|
|
| 63 |
global pdflink
|
| 64 |
#for 2.7
|
| 65 |
global hatched_areas2_7
|
|
|
|
| 66 |
@app.route("/", methods=["GET", "POST"])
|
| 67 |
def getInfotoMeasure():
|
| 68 |
return render_template("gui2.html")
|
|
@@ -80,7 +81,7 @@ def check_password():
|
|
| 80 |
|
| 81 |
if password == correct_password:
|
| 82 |
session["authenticated"] = True # Store authentication in session
|
| 83 |
-
print("
|
| 84 |
return jsonify({"authenticated": True}), 200
|
| 85 |
else:
|
| 86 |
return jsonify({"authenticated": False}), 200
|
|
@@ -90,12 +91,14 @@ def check_password():
|
|
| 90 |
def main_gui():
|
| 91 |
print("Session data at mainGUI:", session) # Debugging: Check session data
|
| 92 |
|
|
|
|
| 93 |
if "authenticated" not in session or not session["authenticated"]:
|
| 94 |
print("User not authenticated, redirecting to password page.") # Debugging
|
| 95 |
return redirect(url_for("password_page"))
|
| 96 |
|
| 97 |
return render_template("proposed-GUI.html")
|
| 98 |
|
|
|
|
| 99 |
|
| 100 |
@app.route("/WordSearch",methods=["GET", "POST"])
|
| 101 |
def getInfo2toMeasure():
|
|
|
|
| 63 |
global pdflink
|
| 64 |
#for 2.7
|
| 65 |
global hatched_areas2_7
|
| 66 |
+
|
| 67 |
@app.route("/", methods=["GET", "POST"])
|
| 68 |
def getInfotoMeasure():
|
| 69 |
return render_template("gui2.html")
|
|
|
|
| 81 |
|
| 82 |
if password == correct_password:
|
| 83 |
session["authenticated"] = True # Store authentication in session
|
| 84 |
+
print("Password correct. Session data set:", session) # Debugging: Print session after setting it
|
| 85 |
return jsonify({"authenticated": True}), 200
|
| 86 |
else:
|
| 87 |
return jsonify({"authenticated": False}), 200
|
|
|
|
| 91 |
def main_gui():
|
| 92 |
print("Session data at mainGUI:", session) # Debugging: Check session data
|
| 93 |
|
| 94 |
+
# If session does not have "authenticated" or it is False, redirect to password page
|
| 95 |
if "authenticated" not in session or not session["authenticated"]:
|
| 96 |
print("User not authenticated, redirecting to password page.") # Debugging
|
| 97 |
return redirect(url_for("password_page"))
|
| 98 |
|
| 99 |
return render_template("proposed-GUI.html")
|
| 100 |
|
| 101 |
+
|
| 102 |
|
| 103 |
@app.route("/WordSearch",methods=["GET", "POST"])
|
| 104 |
def getInfo2toMeasure():
|