diff --git a/backend/handlers/handle_user.go b/backend/handlers/handle_user.go index e1399c2..66032cb 100644 --- a/backend/handlers/handle_user.go +++ b/backend/handlers/handle_user.go @@ -28,7 +28,10 @@ func (store *Store) CreateUser(ctx *gin.Context) { } user := models.User{Username: input.Username, Password: hashedPassword} - store.DB.Create(&user) + tx := store.DB.Create(&user) + if tx.Error != nil { + ctx.JSON(http.StatusInternalServerError, tx.Error.Error()) + } // Generate JWT token tokens, err := store.Auth.GenerateJWT(&user)