fix backend audit findings (auth, upload, sync, data, ocr, contract)
CI / lint-backend (push) Failing after 1m39s
CI / lint-mobile (push) Canceled after 11m8s
CI / test-backend (push) Canceled after 0s
CI / test-mobile (push) Canceled after 0s
CI / build-backend (push) Canceled after 0s
CI / docker (push) Canceled after 0s
CI / lint-backend (push) Failing after 1m39s
CI / lint-mobile (push) Canceled after 11m8s
CI / test-backend (push) Canceled after 0s
CI / test-mobile (push) Canceled after 0s
CI / build-backend (push) Canceled after 0s
CI / docker (push) Canceled after 0s
This commit is contained in:
@@ -21,7 +21,9 @@ func NormalizeUsername(username string) string {
|
||||
}
|
||||
|
||||
// EnsureAdmin crée le compte admin au premier démarrage si la table users est
|
||||
// vide. Idempotent : l'env n'écrase jamais un compte existant.
|
||||
// vide. Idempotent : l'env n'écrase jamais un compte existant. Seuls les
|
||||
// comptes ACTIFS comptent (Users.Count filtre deleted_at, #9+A10) : une base
|
||||
// 100% soft-deleted est vue comme vide et reçoit un nouvel admin.
|
||||
func EnsureAdmin(repo *repository.Repository, username, password string) error {
|
||||
count, err := repo.Users.Count()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user