Fix: Passwort-Reset deaktiviert jetzt auch MFA
Beim Admin-Passwort-Reset werden mfa_enabled, mfa_secret, mfa_recovery_codes und trusted_devices zurückgesetzt.
This commit is contained in:
6
app.py
6
app.py
@@ -1922,8 +1922,12 @@ def admin_users_reset_password(email):
|
||||
temp_password = secrets.choice(string.ascii_lowercase) + secrets.choice(string.ascii_uppercase) + secrets.choice(string.digits) + secrets.token_hex(4)
|
||||
users[email]["password_hash"] = generate_password_hash(temp_password)
|
||||
users[email]["must_change_password"] = True
|
||||
users[email]["mfa_enabled"] = False
|
||||
users[email]["mfa_secret"] = ""
|
||||
users[email]["mfa_recovery_codes"] = []
|
||||
users[email]["trusted_devices"] = []
|
||||
save_users(users)
|
||||
add_history_entry("user_password_reset", f"Passwort für User '{email}' zurückgesetzt", current_user.email)
|
||||
add_history_entry("user_password_reset", f"Passwort für User '{email}' zurückgesetzt (MFA deaktiviert)", current_user.email)
|
||||
|
||||
return redirect(f"/admin/users?reset={email}&temp={temp_password}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user