fix user login and register

This commit is contained in:
Fran Jurmanović
2023-10-07 01:05:44 +02:00
parent cc622c2670
commit 48cffcbcfe
4 changed files with 29 additions and 7 deletions

View File

@@ -51,6 +51,14 @@ func (rc *UserController) PostLogin(c *gin.Context) {
c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
return
}
if body.Email == "" {
c.JSON(400, "Email cannot be empty!")
return
}
if body.Password == "" {
c.JSON(400, "Password cannot be empty!")
return
}
returnedUser, exceptionReturn := rc.service.Login(c, body)
if exceptionReturn.Message != "" {