fix: seed_admin() no longer resets admin password on restart
Remove hash verification + password reset logic. seed_admin() now only creates the admin account if it does not exist. Prevents password being reset to default + must_change_password flag being set on every server restart.
This commit is contained in:
@@ -790,3 +790,8 @@
|
||||
- **Các file ảnh hưởng:** `app/static/js/app.jsx`
|
||||
- **Ghi chú/Test (nếu có):** `npm run build` — build passes.
|
||||
---
|
||||
|
||||
### [2026-07-29 11:27] Task: Fix seed_admin() resetting admin password on every restart
|
||||
- **Tóm tắt thay đổi:** Xóa `else` branch trong `seed_admin()` — từng kiểm tra `if not verify_password(default_pwd, ...)` và reset password admin về `admin123` + `must_change_password=1` mỗi lần server restart nếu password đã bị đổi. Giờ chỉ create admin khi chưa tồn tại.
|
||||
- **Các file ảnh hưởng:** `app/core/auth.py`
|
||||
---
|
||||
|
||||
Reference in New Issue
Block a user