Rotate the session just after login (#2483)

* Rotate the session just after login

* Add pending deletion of user to admin panel

* reforemat
This commit is contained in:
Adrià Casajús 2025-05-28 15:24:04 +02:00 committed by GitHub
parent ee04839572
commit a6f389470c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 0 deletions

View file

@ -1,3 +1,4 @@
import uuid
from time import time
from typing import Optional
@ -33,6 +34,8 @@ def after_login(user, next_url, login_from_proton: bool = False):
return redirect(url_for("auth.mfa"))
LOG.d("log user %s in", user)
# Change session_id so that session cannot be re-used
session.session_id = str(uuid.uuid4())
login_user(user)
session["sudo_time"] = int(time())

View file

@ -10,6 +10,7 @@
<th scope="col">Email</th>
<th scope="col">Verified</th>
<th scope="col">Status</th>
<th scope="col">Pending deletion</th>
<th scope="col">Paid</th>
<th scope="col">Premium</th>
<th>Subscription</th>
@ -36,6 +37,12 @@
{% else %}
<td class="text-success">Enabled</td>
{% endif %}
{% if user.delete_on %}
<td class="text-danger">{{ user.delete_on }}</td>
{% else %}
<td class="text-success">None</td>
{% endif %}
<td>{{ "yes" if user.is_paid() else "No" }}</td>
<td>{{ "yes" if user.is_premium() else "No" }}</td>
<td>{{ user.get_active_subscription() }}</td>
@ -77,6 +84,7 @@
</thead>
<tbody>
{% for mailbox in mboxes %}
<tr>
<td>{{ mailbox.id }}</td>
<td>