diff options
Diffstat (limited to 'api')
-rw-r--r-- | api/user.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/api/user.go b/api/user.go index 03f8b9e3e..e1d5e83dd 100644 --- a/api/user.go +++ b/api/user.go @@ -370,6 +370,12 @@ func Login(c *Context, w http.ResponseWriter, r *http.Request, user *model.User, func login(c *Context, w http.ResponseWriter, r *http.Request) { props := model.MapFromJson(r.Body) + if len(props["password"]) == 0 { + c.Err = model.NewAppError("login", "Password field must not be blank", "") + c.Err.StatusCode = http.StatusForbidden + return + } + var user *model.User if len(props["id"]) != 0 { user = LoginById(c, w, r, props["id"], props["password"], props["device_id"]) |