diff options
Diffstat (limited to 'backend/auth/password.go')
| -rw-r--r-- | backend/auth/password.go | 9 |
1 files changed, 9 insertions, 0 deletions
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 +} |
