fix: restore default admin password and add reset flag
Restored 'admin123' as the default password in db init and added a -reset-admin flag to main.go.
This commit is contained in:
@@ -159,7 +159,7 @@ func (db *DB) RunMigrations() error {
|
||||
}
|
||||
|
||||
if count == 0 {
|
||||
hash, err := bcrypt.GenerateFromPassword([]byte("admin"), 12)
|
||||
hash, err := bcrypt.GenerateFromPassword([]byte("admin123"), 12)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to hash default password: %w", err)
|
||||
}
|
||||
@@ -167,7 +167,7 @@ func (db *DB) RunMigrations() error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to insert default admin: %w", err)
|
||||
}
|
||||
log.Println("Created default admin user with password 'admin' (must change on first login)")
|
||||
log.Println("Created default admin user with password 'admin123' (must change on first login)")
|
||||
}
|
||||
|
||||
// Default client
|
||||
|
||||
Reference in New Issue
Block a user