feat(prod): add allow register and chatgpt model into env file

This commit is contained in:
Leons Aleksandrovs
2025-07-13 21:59:42 +03:00
parent 6d13680e99
commit dd93438ad2
5 changed files with 21 additions and 3 deletions
+6
View File
@@ -25,6 +25,12 @@ type RegisterForm struct {
}
func Register(c *gin.Context) {
// Check for register environment
if config.Env["REGISTER"] != "true" {
res.Error(c, "Registration is disabled", http.StatusForbidden)
return
}
// Receive data from frontend, check if data is okay, hash password, call model
var data RegisterForm
if err := c.ShouldBindJSON(&data); err != nil {