fix logout not redirecting and make the unathorized redirect to login

This commit is contained in:
csd4ni3l
2025-08-12 18:19:44 +02:00
parent f033c9da62
commit 2775f3bfec

View File

@@ -226,10 +226,10 @@ def info():
@app.route('/logout') @app.route('/logout')
def logout(): def logout():
flask_login.logout_user() flask_login.logout_user()
return 'Logged out' return redirect(url_for("/"))
@login_manager.unauthorized_handler @login_manager.unauthorized_handler
def unauthorized_handler(): def unauthorized_handler():
return redirect("/login") return redirect(url_for("login"))
app.run(port=os.environ.get("PORT"), host=os.environ.get("HOST", "0.0.0.0")) app.run(port=os.environ.get("PORT"), host=os.environ.get("HOST", "0.0.0.0"))