Add user registration with password hashing and restructure handlers directory
This commit is contained in:
10
internal/auth/password.go
Normal file
10
internal/auth/password.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user