Marthee commited on
Commit
c2a6a94
·
verified ·
1 Parent(s): 6a83965

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -63,12 +63,10 @@ global colorsused
63
  global pdflink
64
  #for 2.7
65
  global hatched_areas2_7
66
-
67
- @app.route("/",methods=["GET", "POST"])
68
  def getInfotoMeasure():
69
- # API.AppendtablestoSheets()
70
  return render_template("gui2.html")
71
-
72
  # Password Page Route
73
  @app.route("/password", methods=["GET", "POST"])
74
  def password_page():
@@ -82,6 +80,7 @@ def check_password():
82
 
83
  if password == correct_password:
84
  session["authenticated"] = True # Store authentication in session
 
85
  return jsonify({"authenticated": True}), 200
86
  else:
87
  return jsonify({"authenticated": False}), 200
@@ -89,13 +88,15 @@ def check_password():
89
  # Main GUI Route (Checks Authentication)
90
  @app.route("/mainGUI", methods=["GET", "POST"])
91
  def main_gui():
92
- print("Session data:", session) # Debugging: check session contents
93
 
94
  if "authenticated" not in session or not session["authenticated"]:
 
95
  return redirect(url_for("password_page"))
96
 
97
  return render_template("proposed-GUI.html")
98
 
 
99
  @app.route("/WordSearch",methods=["GET", "POST"])
100
  def getInfo2toMeasure():
101
  # API.AppendtablestoSheets()
 
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")
69
+
70
  # Password Page Route
71
  @app.route("/password", methods=["GET", "POST"])
72
  def password_page():
 
80
 
81
  if password == correct_password:
82
  session["authenticated"] = True # Store authentication in session
83
+ print("Authentication successful. Session data:", session) # Debugging: Check session data
84
  return jsonify({"authenticated": True}), 200
85
  else:
86
  return jsonify({"authenticated": False}), 200
 
88
  # Main GUI Route (Checks Authentication)
89
  @app.route("/mainGUI", methods=["GET", "POST"])
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():
102
  # API.AppendtablestoSheets()