Fix: no password case
This commit is contained in:
@@ -79,9 +79,12 @@ func HandleFrontLogin(w http.ResponseWriter, r *http.Request) {
|
||||
// make sure username does not exists
|
||||
cleanName := utils.RemoveSpacesFromStr(username)
|
||||
clearPass := utils.RemoveSpacesFromStr(password)
|
||||
var hashedPass string
|
||||
if clearPass != "" {
|
||||
// hash the password with md5
|
||||
hash := md5.Sum([]byte(clearPass))
|
||||
hashedPass := hex.EncodeToString(hash[:])
|
||||
hashedPass = hex.EncodeToString(hash[:])
|
||||
}
|
||||
// check if that user was already in db
|
||||
userstate, err := repo.PlayerGetByName(r.Context(), cleanName)
|
||||
if err != nil || userstate == nil {
|
||||
|
||||
Reference in New Issue
Block a user