diff --git a/src/handler/userHandler.go b/src/handler/userHandler.go index 11edb75..63b52e3 100644 --- a/src/handler/userHandler.go +++ b/src/handler/userHandler.go @@ -11,8 +11,19 @@ import ( func CreateUser(context *gin.Context) { var loginObj models.LoginRequest - if !shouldBindJSON(context, &loginObj) { - return + context.MultipartForm() + for key, value := range context.Request.PostForm { + if key == "Username" { + loginObj.UserName = value[0] + } else if key == "password" { + loginObj.Password = value[0] + } + } + + if loginObj.UserName == "" && loginObj.Password == "" { + if !shouldBindJSON(context, &loginObj) { + return + } } if err := loginObj.IsValid(); err != nil { diff --git a/src/templates/views/register.html b/src/templates/views/register.html index d430b2e..0ab16df 100644 --- a/src/templates/views/register.html +++ b/src/templates/views/register.html @@ -1,27 +1,25 @@ - - -

Account Registration


-
- -
-
-
-
-

- -
- -

-{{if .}} - {{.}} -{{end}} - - + + + + + + + + + + +
+

Kayıt

+ + + + +
+ \ No newline at end of file