S SmartDocs
Chuỗi bài: Go go 15 dòng · Cập nhật 2026-04-18

password_test.go

Go/Baasid/internal/auth/password_test.go

package auth

import "testing"

// Ensures the bcrypt string embedded in scripts/seed_data.sql still matches
// the documented demo password ("password").
func TestSeedSQLHashMatchesPassword(t *testing.T) {
	const (
		laravelDefaultHash = "$2a$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi"
		plain              = "password"
	)
	if !CheckPassword(laravelDefaultHash, plain) {
		t.Fatal("seed SQL bcrypt hash does not match plaintext 'password' — update scripts/seed_data.sql")
	}
}

Bài viết liên quan