Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
returning 401 for unauthorized API calls while redirecting to /login for unauthorized page access
azivner734b45dc6767
diff --git a/TODO b/TODOindex b12d43b8e4..d9d3e5043c 100644--- a/TODO+++ b/TODO@@ -1,4 +1,7 @@- logout detection- conflict detection- note title and content changes are not in audit_log table-- deleting cloned nodes ends with 500 (probably only on folders)\ No newline at end of file+- deleting cloned nodes ends with 500 (probably only on folders)+- what links here+- recent changes - link to note should lead to the revision+- db upgrade / migrationdiff --git a/src/app.py b/src/app.pyindex c1c0030033..b3d4309906 100644--- a/src/app.py+++ b/src/app.py@@ -101,6 +101,13 @@ def load_user(user_id):else:return None+@login_manager.unauthorized_handler+def unauthorized_handler():+ if request.path.startswith('/api'):+ return 'Unauthorized', 401+ else:+ return redirect('/login')+if __name__ == "__main__":ssl_context = None