- Remove backend Medusa.js (TypeScript) e substitui pelo backend Go (saveinmed-performance-core) - Corrige testes auth.test.ts: alinha paths de API (v1/ sem barra inicial) e campo access_token - Corrige GroupedProductCard.test.tsx: ajusta distância formatada (toFixed) e troca userEvent por fireEvent com fakeTimers - Corrige AuthContext.test.tsx: usa vi.hoisted() para mocks e corrige parênteses no waitFor Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
46 lines
1.1 KiB
Go
46 lines
1.1 KiB
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
|
|
_ "github.com/jackc/pgx/v5/stdlib"
|
|
"github.com/jmoiron/sqlx"
|
|
"github.com/saveinmed/backend-go/internal/config"
|
|
)
|
|
|
|
func main() {
|
|
cfg, err := config.Load()
|
|
if err != nil {
|
|
log.Fatalf("failed to load config: %v", err)
|
|
}
|
|
|
|
db, err := sqlx.Open("pgx", cfg.DatabaseURL)
|
|
if err != nil {
|
|
log.Fatalf("Failed to connect to DB: %v", err)
|
|
}
|
|
defer db.Close()
|
|
|
|
var users []struct {
|
|
ID string `db:"id"`
|
|
Username string `db:"username"`
|
|
Email string `db:"email"`
|
|
Role string `db:"role"`
|
|
PasswordHash string `db:"password_hash"`
|
|
}
|
|
|
|
err = db.Select(&users, "SELECT id, username, email, role, password_hash FROM users")
|
|
if err != nil {
|
|
log.Fatalf("Query failed: %v", err)
|
|
}
|
|
|
|
if len(users) == 0 {
|
|
log.Println("❌ No user found with username 'lojista_novo' or email 'lojista_novo@saveinmed.com'")
|
|
} else {
|
|
for _, u := range users {
|
|
log.Printf("Found user: ID=%s, Username=%s, Email=%s, Role=%s, HasHash=%v", u.ID, u.Username, u.Email, u.Role, u.PasswordHash != "")
|
|
if len(u.PasswordHash) > 0 {
|
|
log.Printf("Hash prefix: %s", u.PasswordHash[:10])
|
|
}
|
|
}
|
|
}
|
|
}
|