You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by ra...@apache.org on 2019/08/30 21:55:39 UTC
[trafficcontrol] branch 3.1.x updated: Improve ldap error handling
This is an automated email from the ASF dual-hosted git repository.
rawlin pushed a commit to branch 3.1.x
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git
The following commit(s) were added to refs/heads/3.1.x by this push:
new 4200c11 Improve ldap error handling
4200c11 is described below
commit 4200c11b1d1b12edce5d0cf145f7f57fd748ca82
Author: Rawlin Peters <ra...@comcast.com>
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
}{}