Add user registration with password hashing and restructure handlers directory

This commit is contained in:
2025-05-15 12:10:16 +03:30
parent 7aa8c26da9
commit b3fae6b80c
12 changed files with 124 additions and 45 deletions

10
internal/auth/password.go Normal file
View File

@@ -0,0 +1,10 @@
package auth
import (
"golang.org/x/crypto/bcrypt"
)
func HashPassword(password string) (string, error) {
bytes, err := bcrypt.GenerateFromPassword([]byte(password), bcrypt.DefaultCost)
return string(bytes), err
}