diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-11-06 04:10:55 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-11-08 05:04:02 +0900 |
| commit | e0cc2915f22fe74d5be9e8f51d6b73437192e0ba (patch) | |
| tree | e2e27e3cba8b5e7205732eef7b6df9789e83396f /backend/auth/password.go | |
| parent | ba1e0c904f810193f25d4f88cc2bb168f1d625fe (diff) | |
| download | feedaka-e0cc2915f22fe74d5be9e8f51d6b73437192e0ba.tar.gz feedaka-e0cc2915f22fe74d5be9e8f51d6b73437192e0ba.tar.zst feedaka-e0cc2915f22fe74d5be9e8f51d6b73437192e0ba.zip | |
feat: Support multi-user
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 +} |
