Spaces:
Running
Running
David Ko
commited on
Commit
·
68634f6
1
Parent(s):
913f3b4
Fix routing conflict causing redirect loop after login
Browse files
api.py
CHANGED
@@ -1171,6 +1171,7 @@ def logout():
|
|
1171 |
@login_required
|
1172 |
def serve_react(path):
|
1173 |
"""Serve React frontend"""
|
|
|
1174 |
if path != "" and os.path.exists(os.path.join(app.static_folder, path)):
|
1175 |
return send_from_directory(app.static_folder, path)
|
1176 |
else:
|
@@ -1208,11 +1209,8 @@ def status():
|
|
1208 |
"user": current_user.username
|
1209 |
})
|
1210 |
|
1211 |
-
|
1212 |
-
|
1213 |
-
def index():
|
1214 |
-
print(f"Root route accessed, user authenticated: {current_user.is_authenticated}")
|
1215 |
-
return send_from_directory('static', 'index.html')
|
1216 |
|
1217 |
@app.route('/index')
|
1218 |
@login_required
|
|
|
1171 |
@login_required
|
1172 |
def serve_react(path):
|
1173 |
"""Serve React frontend"""
|
1174 |
+
print(f"Serving React frontend for path: {path}, user: {current_user.username}")
|
1175 |
if path != "" and os.path.exists(os.path.join(app.static_folder, path)):
|
1176 |
return send_from_directory(app.static_folder, path)
|
1177 |
else:
|
|
|
1209 |
"user": current_user.username
|
1210 |
})
|
1211 |
|
1212 |
+
# Root route is now handled by serve_react function
|
1213 |
+
# This route is removed to prevent conflicts
|
|
|
|
|
|
|
1214 |
|
1215 |
@app.route('/index')
|
1216 |
@login_required
|