auth: Add a logout button
Add a logout button that clears the auth cookies, logging out the user. It also tries to remove the auth token from the databse, but will ignore any error during the database operation. Do some include clean-ups as well.
This commit is contained in:
parent
36be6b51ae
commit
c4e252dbc2
4 changed files with 33 additions and 11 deletions
|
@ -43,7 +43,10 @@
|
|||
<div class="top_bar">
|
||||
<h1>{{ title }}</h1>
|
||||
{% if user.logged_in == true %}
|
||||
<p>Connecté en tant que <b>{{ user.name }}</b></p>
|
||||
<form class="login" id="logout" action="/{{ week_data.number }}/logout" method="POST">
|
||||
Connecté en tant que <b>{{ user.name }}</b>
|
||||
<button form="logout">Déconnecter</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<form class="login" id="login" action="/{{ week_data.number }}/login" method="POST">
|
||||
<label>Pseudo <input form="login" type="text" name="name"/></label>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue