revert admin password logging to slog.Info (closes #26)
All checks were successful
check / check (push) Successful in 1m58s

This commit is contained in:
clawbot 2026-03-01 21:26:31 -08:00
parent 43c22a9e9a
commit 8f62fde8e9

View File

@ -3,9 +3,7 @@ package database
import (
"context"
"database/sql"
"fmt"
"log/slog"
"os"
"go.uber.org/fx"
"gorm.io/driver/sqlite"
@ -120,17 +118,10 @@ func (d *Database) migrate() error {
return err
}
// Print the password directly to stderr so it never ends up in
// structured JSON log aggregation. This message is only shown
// once on first startup.
fmt.Fprintf(os.Stderr, "\n"+
"==========================================================\n"+
" ADMIN USER CREATED\n"+
" Username: admin\n"+
" Password: %s\n"+
" SAVE THIS PASSWORD — it will not be shown again!\n"+
"==========================================================\n\n",
password,
d.log.Info("admin user created",
"username", "admin",
"password", password,
"message", "SAVE THIS PASSWORD - it will not be shown again!",
)
}