feat(web_server.py): remove redirect when logged in and trying to access /
This commit is contained in:
@@ -49,7 +49,7 @@ PC_DETAILS = {
|
||||
"id": "PC7",
|
||||
"status": "offline",
|
||||
"last_seen": "2023-10-01 11:00:00",
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -79,12 +79,9 @@ def load_user(user_id: str) -> User | None:
|
||||
@app.route("/")
|
||||
def index() -> flask.Response | str:
|
||||
"""Renders the index page with a link to the login page."""
|
||||
if flask_login.current_user.is_authenticated:
|
||||
return flask.redirect(flask.url_for("panel"))
|
||||
else:
|
||||
return flask.render_template(
|
||||
"index.html", logged=False, login_url=flask.url_for("login")
|
||||
)
|
||||
return flask.render_template(
|
||||
"index.html", logged=flask_login.current_user.is_authenticated
|
||||
)
|
||||
|
||||
|
||||
@app.route("/login", methods=["GET", "POST"])
|
||||
|
||||
Reference in New Issue
Block a user