mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-02-06 06:08:16 +00:00
fix user login and register
This commit is contained in:
@@ -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 != "" {
|
||||
|
||||
Reference in New Issue
Block a user