Use session to store authentication info instead of cookie

This commit is contained in:
2023-08-20 14:10:44 +02:00
committed by Shirkanesi
parent bc9336ef21
commit c453e923ae
4 changed files with 27 additions and 30 deletions
+5 -5
View File
@@ -76,10 +76,10 @@
<h1>jon</h1>
<nav>
<ul>
<li {{ "class=current-page" if request.path == "/" else "" }}><a href="/">Home</a></li>
<li {{ "class=current-page" if request.path.startswith("/inventory") else "" }}><a href="/inventory">Inventar</a></li>
<li {{ "class=current-page" if request.path.startswith("/entry") else "" }}><a href="/entry">Eintragen</a></li>
<li {{ "class=current-page" if request.path.startswith("/location") else "" }}>
<li{{ " class=current-page" if request.path == "/" else "" }}><a href="/">Home</a></li>
<li{{ " class=current-page" if request.path.startswith("/inventory") else "" }}><a href="/inventory">Inventar</a></li>
<li{{ " class=current-page" if request.path.startswith("/entry") else "" }}><a href="/entry">Eintragen</a></li>
<li{{ " class=current-page" if request.path.startswith("/location") else "" }}>
<a href="/location">
{% if "location" not in session %}
Raum wählen
@@ -88,7 +88,7 @@
{% endif %}
</a>
</li>
<li {{ "class=current-page" if request.path.startswith("/logout") else "" }}><a href="/logout">Logout</a></li>
<li{{ " class=current-page" if request.path.startswith("/auth/logout") else "" }}><a href="/auth/logout">Logout</a></li>
</ul>
</nav>
+1 -1
View File
@@ -1,7 +1,7 @@
{% extends "base.html" %}
{% block content %}
<form method="POST" action=".">
<form method="POST">
<select name="location_id">
<option value="" {{ "selected" if "location" not in session else ""}}>-</option>
{% for location in locations %}