From e0bc32265cb6c9d937ac40c276be398ae053af82 Mon Sep 17 00:00:00 2001 From: dreth Date: Fri, 4 Oct 2024 13:01:20 +0200 Subject: [PATCH] passwords should be reusable --- backend/auth/auth.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/backend/auth/auth.go b/backend/auth/auth.go index 4681a80..4479a76 100644 --- a/backend/auth/auth.go +++ b/backend/auth/auth.go @@ -94,11 +94,7 @@ func Register(c *gin.Context) { // Hash the password to check for uniqueness PasswordHash := encryption.HashStringWithSHA256(req.Password) - if exists, err = models.Users(models.UserWhere.PasswordHash.EQ(PasswordHash)).Exists(c, env.DB); helper.HE(c, err, http.StatusInternalServerError, "failed to check existing user", false) { - return - } - if exists { - c.JSON(http.StatusConflict, gin.H{"error": "password already registered"}) + if _, err = models.Users(models.UserWhere.PasswordHash.EQ(PasswordHash)).Exists(c, env.DB); helper.HE(c, err, http.StatusInternalServerError, "failed to check existing user", false) { return }