From e0cc2915f22fe74d5be9e8f51d6b73437192e0ba Mon Sep 17 00:00:00 2001 From: nsfisis Date: Thu, 6 Nov 2025 04:10:55 +0900 Subject: feat: Support multi-user --- backend/auth/password.go | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 backend/auth/password.go (limited to 'backend/auth/password.go') diff --git a/backend/auth/password.go b/backend/auth/password.go new file mode 100644 index 0000000..2bb3490 --- /dev/null +++ b/backend/auth/password.go @@ -0,0 +1,9 @@ +package auth + +import "golang.org/x/crypto/bcrypt" + +// VerifyPassword checks if the provided password matches the hashed password +func VerifyPassword(hashedPassword, password string) bool { + err := bcrypt.CompareHashAndPassword([]byte(hashedPassword), []byte(password)) + return err == nil +} -- cgit v1.2.3-70-g09d2