This is an automated email from the ASF dual-hosted git repository.
rawlin pushed a commit to branch 3.0.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/3.0.x by this push:
new 54f105d Improve ldap error handling
54f105d is described below
commit 54f105dfd6069945ec12c89d965532e6f5185935
Author: Rawlin Peters <[email protected]>
AuthorDate: Fri Aug 30 14:40:48 2019 -0600
Improve ldap error handling
(cherry picked from commit 6ae2730947fbb8b0ca1f01435b5bf396089213d9)
---
traffic_ops/traffic_ops_golang/login/login.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/traffic_ops/traffic_ops_golang/login/login.go
b/traffic_ops/traffic_ops_golang/login/login.go
index 1a59722..4fb336a 100644
--- a/traffic_ops/traffic_ops_golang/login/login.go
+++ b/traffic_ops/traffic_ops_golang/login/login.go
@@ -45,6 +45,10 @@ func LoginHandler(db *sqlx.DB, cfg config.Config)
http.HandlerFunc {
handleErrs(http.StatusBadRequest, err)
return
}
+ if form.Username == "" || form.Password == "" {
+ api.HandleErr(w, r, nil, http.StatusBadRequest,
errors.New("username and password are required"), nil)
+ return
+ }
resp := struct {
tc.Alerts
}{}