fix bag with save uder 00 uuid
This commit is contained in:
@@ -6,6 +6,8 @@ import (
|
|||||||
"encoding/json"
|
"encoding/json"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"github.com/google/uuid"
|
||||||
|
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -23,7 +25,11 @@ func Register(w http.ResponseWriter, r *http.Request) {
|
|||||||
w.WriteHeader(http.StatusInternalServerError)
|
w.WriteHeader(http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
id := uuid.New()
|
||||||
|
|
||||||
user := models.User{
|
user := models.User{
|
||||||
|
Id: id,
|
||||||
Name: Crenetials.Name,
|
Name: Crenetials.Name,
|
||||||
Email: Crenetials.Email,
|
Email: Crenetials.Email,
|
||||||
Password: hashedPassword,
|
Password: hashedPassword,
|
||||||
|
|||||||
Reference in New Issue
Block a user